diff --git a/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml index e1fb55655..3af3ce9de 100644 --- a/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -241,6 +241,19 @@ spec: version: description: version is the version of the thing you're tracking type: string + version: + description: Version represents the version of the compoenents in klusterlet + type: object + properties: + klusterlet: + description: Klusterlet is the version of klusterlet operator + type: string + registration: + description: Registration is the version of the registration agent + type: string + work: + description: Work is the version of the work agent + type: string served: true storage: true subresources: diff --git a/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml b/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml index cd494bff1..9066ed3f9 100644 --- a/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml +++ b/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml @@ -223,6 +223,22 @@ spec: version: description: version is the version of the thing you're tracking type: string + version: + description: Version represents the version of the compoenents in cluster manager + type: object + properties: + clusterManager: + description: ClusterManager is the version of cluster manager operator + type: string + placement: + description: Placement is the version of the placement controller + type: string + registration: + description: Registration is the version of the registration controller and webhoook + type: string + work: + description: Work is the version of the work webhook + type: string served: true storage: true subresources: diff --git a/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml index b3d09718a..63e1c485c 100644 --- a/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -241,6 +241,19 @@ spec: version: description: version is the version of the thing you're tracking type: string + version: + description: Version represents the version of the compoenents in klusterlet + type: object + properties: + klusterlet: + description: Klusterlet is the version of klusterlet operator + type: string + registration: + description: Registration is the version of the registration agent + type: string + work: + description: Work is the version of the work agent + type: string version: v1 versions: - name: v1 diff --git a/operator/v1/types.go b/operator/v1/types.go index 428c00353..1cbaba699 100644 --- a/operator/v1/types.go +++ b/operator/v1/types.go @@ -127,6 +127,9 @@ type ClusterManagerStatus struct { // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // Version represents the version of the compoenents in cluster manager + Version ClusterManagerVersion `json:"version,omitempty"` + // Conditions contain the different condition statuses for this ClusterManager. // Valid condition types are: // Applied: Components in hub are applied. @@ -145,6 +148,21 @@ type ClusterManagerStatus struct { RelatedResources []RelatedResourceMeta `json:"relatedResources,omitempty"` } +// ClusterManagerVersion represents the version of the compoenents in cluster manager +type ClusterManagerVersion struct { + // ClusterManager is the version of cluster manager operator + ClusterManager string `json:"clusterManager,omitempty"` + + // Registration is the version of the registration controller and webhoook + Registration string `json:"registration,omitempty"` + + // Work is the version of the work webhook + Work string `json:"work,omitempty"` + + // Placement is the version of the placement controller + Placement string `json:"placement,omitempty"` +} + // RelatedResourceMeta represents the resource that is managed by an operator type RelatedResourceMeta struct { // group is the group of the resource that you're tracking @@ -297,12 +315,27 @@ type NodePlacement struct { Tolerations []v1.Toleration `json:"tolerations,omitempty"` } +// KlusterletVersion represents the version of the compoenents in klusterlet +type KlusterletVersion struct { + // Klusterlet is the version of klusterlet operator + Klusterlet string `json:"klusterlet,omitempty"` + + // Registration is the version of the registration agent + Registration string `json:"registration,omitempty"` + + // Work is the version of the work agent + Work string `json:"work,omitempty"` +} + // KlusterletStatus represents the current status of Klusterlet agent. type KlusterletStatus struct { // ObservedGeneration is the last generation change you've dealt with // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // Version represents the version of the compoenents in klusterlet + Version KlusterletVersion `json:"version,omitempty"` + // Conditions contain the different condition statuses for this Klusterlet. // Valid condition types are: // Applied: Components have been applied in the managed cluster. diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 56ed4c9f4..ae0938494 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -93,6 +93,7 @@ func (in *ClusterManagerSpec) DeepCopy() *ClusterManagerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterManagerStatus) DeepCopyInto(out *ClusterManagerStatus) { *out = *in + out.Version = in.Version if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]metav1.Condition, len(*in)) @@ -123,6 +124,22 @@ func (in *ClusterManagerStatus) DeepCopy() *ClusterManagerStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterManagerVersion) DeepCopyInto(out *ClusterManagerVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterManagerVersion. +func (in *ClusterManagerVersion) DeepCopy() *ClusterManagerVersion { + if in == nil { + return nil + } + out := new(ClusterManagerVersion) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeployOption) DeepCopyInto(out *DeployOption) { *out = *in @@ -267,6 +284,7 @@ func (in *KlusterletSpec) DeepCopy() *KlusterletSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KlusterletStatus) DeepCopyInto(out *KlusterletStatus) { *out = *in + out.Version = in.Version if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]metav1.Condition, len(*in)) @@ -297,6 +315,22 @@ func (in *KlusterletStatus) DeepCopy() *KlusterletStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KlusterletVersion) DeepCopyInto(out *KlusterletVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KlusterletVersion. +func (in *KlusterletVersion) DeepCopy() *KlusterletVersion { + if in == nil { + return nil + } + out := new(KlusterletVersion) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePlacement) DeepCopyInto(out *NodePlacement) { *out = *in diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index c78efe88c..ca61e904f 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -47,6 +47,7 @@ func (ClusterManagerSpec) SwaggerDoc() map[string]string { var map_ClusterManagerStatus = map[string]string{ "": "ClusterManagerStatus represents the current status of the registration and work distribution controllers running on the hub.", "observedGeneration": "ObservedGeneration is the last generation change you've dealt with", + "version": "Version represents the version of the compoenents in cluster manager", "conditions": "Conditions contain the different condition statuses for this ClusterManager. Valid condition types are: Applied: Components in hub are applied. Available: Components in hub are available and ready to serve. Progressing: Components in hub are in a transitioning state. Degraded: Components in hub do not match the desired configuration and only provide degraded service.", "generations": "Generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", "relatedResources": "RelatedResources are used to track the resources that are related to this ClusterManager.", @@ -56,6 +57,18 @@ func (ClusterManagerStatus) SwaggerDoc() map[string]string { return map_ClusterManagerStatus } +var map_ClusterManagerVersion = map[string]string{ + "": "ClusterManagerVersion represents the version of the compoenents in cluster manager", + "clusterManager": "ClusterManager is the version of cluster manager operator", + "registration": "Registration is the version of the registration controller and webhoook", + "work": "Work is the version of the work webhook", + "placement": "Placement is the version of the placement controller", +} + +func (ClusterManagerVersion) SwaggerDoc() map[string]string { + return map_ClusterManagerVersion +} + var map_DeployOption = map[string]string{ "": "DeployOption describes the deploy options for cluster-manager or klusterlet", "mode": "Mode can be Default or Detached. For cluster-manager:\n - In Default mode, the Hub is installed as a whole and all parts of Hub are deployed in the same cluster.\n - In Detached mode, only crd and configurations are installed on one cluster(defined as hub-cluster). Controllers run in another cluster (defined as management-cluster) and connect to the hub with the kubeconfig in secret of \"external-hub-kubeconfig\"(a kubeconfig of hub-cluster with cluster-admin permission).\nFor klusterlet:\n - In Default mode, all klusterlet related resources are deployed on the managed cluster.\n - In Detached mode, only crd and configurations are installed on the spoke/managed cluster. Controllers run in another cluster (defined as management-cluster) and connect to the mangaged cluster with the kubeconfig in secret of \"external-managed-kubeconfig\"(a kubeconfig of managed-cluster with cluster-admin permission).\nThe purpose of Detached mode is to give it more flexibility, for example we can install a hub on a cluster with no worker nodes, meanwhile running all deployments on another more powerful cluster. And we can also register a managed cluster to the hub that has some firewall rules preventing access from the managed cluster.\n\nNote: Do not modify the Mode field once it's applied.", @@ -128,6 +141,7 @@ func (KlusterletSpec) SwaggerDoc() map[string]string { var map_KlusterletStatus = map[string]string{ "": "KlusterletStatus represents the current status of Klusterlet agent.", "observedGeneration": "ObservedGeneration is the last generation change you've dealt with", + "version": "Version represents the version of the compoenents in klusterlet", "conditions": "Conditions contain the different condition statuses for this Klusterlet. Valid condition types are: Applied: Components have been applied in the managed cluster. Available: Components in the managed cluster are available and ready to serve. Progressing: Components in the managed cluster are in a transitioning state. Degraded: Components in the managed cluster do not match the desired configuration and only provide degraded service.", "generations": "Generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", "relatedResources": "RelatedResources are used to track the resources that are related to this Klusterlet.", @@ -137,6 +151,17 @@ func (KlusterletStatus) SwaggerDoc() map[string]string { return map_KlusterletStatus } +var map_KlusterletVersion = map[string]string{ + "": "KlusterletVersion represents the version of the compoenents in klusterlet", + "klusterlet": "Klusterlet is the version of klusterlet operator", + "registration": "Registration is the version of the registration agent", + "work": "Work is the version of the work agent", +} + +func (KlusterletVersion) SwaggerDoc() map[string]string { + return map_KlusterletVersion +} + var map_NodePlacement = map[string]string{ "": "NodePlacement describes node scheduling configuration for the pods.", "nodeSelector": "NodeSelector defines which Nodes the Pods are scheduled on. The default is an empty list.",