From 3f8f9d95c78cad8a893ff856c90e6c1b821f696e Mon Sep 17 00:00:00 2001 From: Suvaansh <34331549+suvaanshkumar@users.noreply.github.com> Date: Fri, 3 Jan 2025 21:46:57 +0000 Subject: [PATCH 1/8] Updated clustermanager API spec and generated files for spec change. Signed-off-by: EmilyL <70486866+dtclxy64@users.noreply.github.com> --- ...uster-management.io_clustermanagers.crd.yaml | 12 ++++++++++++ operator/v1/types_clustermanager.go | 13 +++++++++++++ operator/v1/zz_generated.deepcopy.go | 17 +++++++++++++++++ .../v1/zz_generated.swagger_doc_generated.go | 13 +++++++++++-- 4 files changed, 53 insertions(+), 2 deletions(-) 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 8e92beeb7..6823d25e9 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 @@ -255,6 +255,18 @@ spec: - feature type: object type: array + registrationDriverHub: + description: This provides details to initialize Hub cluster + properties: + authType: + default: csr + description: Type of the authentication used by hub to initialize + the Hub cluster. Possible values are csr and awsirsa. + enum: + - csr + - awsirsa + type: string + type: object type: object registrationImagePullSpec: default: quay.io/open-cluster-management/registration diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 373f87f10..7ec09af2e 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -108,6 +108,19 @@ type RegistrationHubConfiguration struct { // he can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false. // +optional FeatureGates []FeatureGate `json:"featureGates,omitempty"` + + // This provides details to initialize Hub cluster + // +optional + RegistrationDriverHub RegistrationDriverHub `json:"registrationDriverHub,omitempty"` +} + +type RegistrationDriverHub struct { + + // Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa. + // +required + // +kubebuilder:default:=csr + // +kubebuilder:validation:Enum=csr;awsirsa + AuthType string `json:"authType,omitempty"` } type WorkConfiguration struct { diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 64a618ba5..a5b080e57 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -557,6 +557,22 @@ func (in *RegistrationDriver) DeepCopy() *RegistrationDriver { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegistrationDriverHub) DeepCopyInto(out *RegistrationDriverHub) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrationDriverHub. +func (in *RegistrationDriverHub) DeepCopy() *RegistrationDriverHub { + if in == nil { + return nil + } + out := new(RegistrationDriverHub) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RegistrationHubConfiguration) DeepCopyInto(out *RegistrationHubConfiguration) { *out = *in @@ -570,6 +586,7 @@ func (in *RegistrationHubConfiguration) DeepCopyInto(out *RegistrationHubConfigu *out = make([]FeatureGate, len(*in)) copy(*out, *in) } + out.RegistrationDriverHub = in.RegistrationDriverHub return } diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index 5d63b9197..4ca37436e 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -122,9 +122,18 @@ func (NodePlacement) SwaggerDoc() map[string]string { return map_NodePlacement } +var map_RegistrationDriverHub = map[string]string{ + "authType": "Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa.", +} + +func (RegistrationDriverHub) SwaggerDoc() map[string]string { + return map_RegistrationDriverHub +} + var map_RegistrationHubConfiguration = map[string]string{ - "autoApproveUsers": "AutoApproveUser represents a list of users that can auto approve CSR and accept client. If the credential of the bootstrap-hub-kubeconfig matches to the users, the cluster created by the bootstrap-hub-kubeconfig will be auto-registered into the hub cluster. This takes effect only when ManagedClusterAutoApproval feature gate is enabled.", - "featureGates": "FeatureGates represents the list of feature gates for registration If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", + "autoApproveUsers": "AutoApproveUser represents a list of users that can auto approve CSR and accept client. If the credential of the bootstrap-hub-kubeconfig matches to the users, the cluster created by the bootstrap-hub-kubeconfig will be auto-registered into the hub cluster. This takes effect only when ManagedClusterAutoApproval feature gate is enabled.", + "featureGates": "FeatureGates represents the list of feature gates for registration If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", + "registrationDriverHub": "This provides details to initialize Hub cluster", } func (RegistrationHubConfiguration) SwaggerDoc() map[string]string { From 9c4a71e9b5ecc9144b9dfb3c8d1502d059b2afa4 Mon Sep 17 00:00:00 2001 From: Amrutha Date: Mon, 6 Jan 2025 11:54:30 -0500 Subject: [PATCH 2/8] Renaming the authDriver and updating comments Signed-off-by: Amrutha --- operator/v1/types_clustermanager.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 7ec09af2e..85e9f2dc4 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -109,12 +109,13 @@ type RegistrationHubConfiguration struct { // +optional FeatureGates []FeatureGate `json:"featureGates,omitempty"` - // This provides details to initialize Hub cluster + // AuthDrivers represent the list of authentication drivers for registration + // An AuthDriver helps to specify the type of authentication to be supported by the hub // +optional - RegistrationDriverHub RegistrationDriverHub `json:"registrationDriverHub,omitempty"` + AuthDrivers []AuthDriver `json:"authDrivers,omitempty"` } -type RegistrationDriverHub struct { +type AuthDriver struct { // Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa. // +required From 38bb925aea03792acfd5818e9175132f63b35b87 Mon Sep 17 00:00:00 2001 From: Amrutha Date: Mon, 6 Jan 2025 17:23:15 -0500 Subject: [PATCH 3/8] Added field in AUthDriver to support managed cluster identity creator role ARN Signed-off-by: Amrutha --- operator/v1/types_clustermanager.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 85e9f2dc4..897135ca1 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -122,6 +122,11 @@ type AuthDriver struct { // +kubebuilder:default:=csr // +kubebuilder:validation:Enum=csr;awsirsa AuthType string `json:"authType,omitempty"` + + // This represents the role ARN assumed by registration controller on hub to create roles for each managed cluster + // This ARN follows the naming convention as arn:aws:iam:::role/_managed-cluster-identity-creator + // +optional + ManagedClusterIdentityCreatorRole string `json:"managedClusterIdentityCreatorRole,omitempty"` } type WorkConfiguration struct { From c691e2183ae812d14a34142418260a199564d724 Mon Sep 17 00:00:00 2001 From: Amrutha Date: Tue, 7 Jan 2025 12:21:18 -0500 Subject: [PATCH 4/8] Updating the AuthDriver to contain HubClusterArn Signed-off-by: Amrutha --- operator/v1/types_clustermanager.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 897135ca1..302d5a723 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -123,10 +123,9 @@ type AuthDriver struct { // +kubebuilder:validation:Enum=csr;awsirsa AuthType string `json:"authType,omitempty"` - // This represents the role ARN assumed by registration controller on hub to create roles for each managed cluster - // This ARN follows the naming convention as arn:aws:iam:::role/_managed-cluster-identity-creator + // This represents the hub cluster ARN // +optional - ManagedClusterIdentityCreatorRole string `json:"managedClusterIdentityCreatorRole,omitempty"` + HubClusterArn string `json:"hubClusterArn,omitempty"` } type WorkConfiguration struct { From 10c2d5546aa13a6e8e1deac3304e67b881be47af Mon Sep 17 00:00:00 2001 From: Amrutha Date: Tue, 7 Jan 2025 17:09:37 -0500 Subject: [PATCH 5/8] Adding generated files Signed-off-by: Amrutha --- operator/v1/zz_generated.deepcopy.go | 38 ++++++++++--------- .../v1/zz_generated.swagger_doc_generated.go | 23 +++++------ 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index a5b080e57..84764ec32 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -32,6 +32,22 @@ func (in *AddOnManagerConfiguration) DeepCopy() *AddOnManagerConfiguration { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthDriver) DeepCopyInto(out *AuthDriver) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthDriver. +func (in *AuthDriver) DeepCopy() *AuthDriver { + if in == nil { + return nil + } + out := new(AuthDriver) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AwsIrsa) DeepCopyInto(out *AwsIrsa) { *out = *in @@ -557,22 +573,6 @@ func (in *RegistrationDriver) DeepCopy() *RegistrationDriver { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegistrationDriverHub) DeepCopyInto(out *RegistrationDriverHub) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrationDriverHub. -func (in *RegistrationDriverHub) DeepCopy() *RegistrationDriverHub { - if in == nil { - return nil - } - out := new(RegistrationDriverHub) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RegistrationHubConfiguration) DeepCopyInto(out *RegistrationHubConfiguration) { *out = *in @@ -586,7 +586,11 @@ func (in *RegistrationHubConfiguration) DeepCopyInto(out *RegistrationHubConfigu *out = make([]FeatureGate, len(*in)) copy(*out, *in) } - out.RegistrationDriverHub = in.RegistrationDriverHub + if in.AuthDrivers != nil { + in, out := &in.AuthDrivers, &out.AuthDrivers + *out = make([]AuthDriver, len(*in)) + copy(*out, *in) + } return } diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index 4ca37436e..c866a3286 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -19,6 +19,15 @@ func (AddOnManagerConfiguration) SwaggerDoc() map[string]string { return map_AddOnManagerConfiguration } +var map_AuthDriver = map[string]string{ + "authType": "Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa.", + "hubClusterArn": "This represents the hub cluster ARN", +} + +func (AuthDriver) SwaggerDoc() map[string]string { + return map_AuthDriver +} + var map_ClusterManager = map[string]string{ "": "ClusterManager configures the controllers on the hub that govern registration and work distribution for attached Klusterlets. In Default mode, ClusterManager will only be deployed in open-cluster-management-hub namespace. In Hosted mode, ClusterManager will be deployed in the namespace with the same name as cluster manager.", "spec": "Spec represents a desired deployment configuration of controllers that govern registration and work distribution for attached Klusterlets.", @@ -122,18 +131,10 @@ func (NodePlacement) SwaggerDoc() map[string]string { return map_NodePlacement } -var map_RegistrationDriverHub = map[string]string{ - "authType": "Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa.", -} - -func (RegistrationDriverHub) SwaggerDoc() map[string]string { - return map_RegistrationDriverHub -} - var map_RegistrationHubConfiguration = map[string]string{ - "autoApproveUsers": "AutoApproveUser represents a list of users that can auto approve CSR and accept client. If the credential of the bootstrap-hub-kubeconfig matches to the users, the cluster created by the bootstrap-hub-kubeconfig will be auto-registered into the hub cluster. This takes effect only when ManagedClusterAutoApproval feature gate is enabled.", - "featureGates": "FeatureGates represents the list of feature gates for registration If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", - "registrationDriverHub": "This provides details to initialize Hub cluster", + "autoApproveUsers": "AutoApproveUser represents a list of users that can auto approve CSR and accept client. If the credential of the bootstrap-hub-kubeconfig matches to the users, the cluster created by the bootstrap-hub-kubeconfig will be auto-registered into the hub cluster. This takes effect only when ManagedClusterAutoApproval feature gate is enabled.", + "featureGates": "FeatureGates represents the list of feature gates for registration If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", + "authDrivers": "AuthDrivers represent the list of authentication drivers for registration An AuthDriver helps to specify the type of authentication to be supported by the hub", } func (RegistrationHubConfiguration) SwaggerDoc() map[string]string { From 8f899ea391291ffa6724bae073cce4f8318c8f4f Mon Sep 17 00:00:00 2001 From: Amrutha Date: Wed, 8 Jan 2025 10:41:29 -0500 Subject: [PATCH 6/8] Renaming AuthDriver to RegistrationDriverHub Signed-off-by: Amrutha --- operator/v1/types_clustermanager.go | 8 ++-- operator/v1/zz_generated.deepcopy.go | 38 +++++++++---------- .../v1/zz_generated.swagger_doc_generated.go | 24 ++++++------ 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 302d5a723..83680a76f 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -109,13 +109,13 @@ type RegistrationHubConfiguration struct { // +optional FeatureGates []FeatureGate `json:"featureGates,omitempty"` - // AuthDrivers represent the list of authentication drivers for registration - // An AuthDriver helps to specify the type of authentication to be supported by the hub + // RegistrationDrivers represent the list of hub registration drivers that contain information used by hub to initialize the hub cluster + // A RegistrationDriverHub contains details of authentication type and the hub cluster ARN // +optional - AuthDrivers []AuthDriver `json:"authDrivers,omitempty"` + RegistrationDrivers []RegistrationDriverHub `json:"registrationDrivers,omitempty"` } -type AuthDriver struct { +type RegistrationDriverHub struct { // Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa. // +required diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 84764ec32..96eef484b 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -32,22 +32,6 @@ func (in *AddOnManagerConfiguration) DeepCopy() *AddOnManagerConfiguration { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthDriver) DeepCopyInto(out *AuthDriver) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthDriver. -func (in *AuthDriver) DeepCopy() *AuthDriver { - if in == nil { - return nil - } - out := new(AuthDriver) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AwsIrsa) DeepCopyInto(out *AwsIrsa) { *out = *in @@ -573,6 +557,22 @@ func (in *RegistrationDriver) DeepCopy() *RegistrationDriver { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegistrationDriverHub) DeepCopyInto(out *RegistrationDriverHub) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrationDriverHub. +func (in *RegistrationDriverHub) DeepCopy() *RegistrationDriverHub { + if in == nil { + return nil + } + out := new(RegistrationDriverHub) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RegistrationHubConfiguration) DeepCopyInto(out *RegistrationHubConfiguration) { *out = *in @@ -586,9 +586,9 @@ func (in *RegistrationHubConfiguration) DeepCopyInto(out *RegistrationHubConfigu *out = make([]FeatureGate, len(*in)) copy(*out, *in) } - if in.AuthDrivers != nil { - in, out := &in.AuthDrivers, &out.AuthDrivers - *out = make([]AuthDriver, len(*in)) + if in.RegistrationDrivers != nil { + in, out := &in.RegistrationDrivers, &out.RegistrationDrivers + *out = make([]RegistrationDriverHub, len(*in)) copy(*out, *in) } return diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index c866a3286..fe3a09bd0 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -19,15 +19,6 @@ func (AddOnManagerConfiguration) SwaggerDoc() map[string]string { return map_AddOnManagerConfiguration } -var map_AuthDriver = map[string]string{ - "authType": "Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa.", - "hubClusterArn": "This represents the hub cluster ARN", -} - -func (AuthDriver) SwaggerDoc() map[string]string { - return map_AuthDriver -} - var map_ClusterManager = map[string]string{ "": "ClusterManager configures the controllers on the hub that govern registration and work distribution for attached Klusterlets. In Default mode, ClusterManager will only be deployed in open-cluster-management-hub namespace. In Hosted mode, ClusterManager will be deployed in the namespace with the same name as cluster manager.", "spec": "Spec represents a desired deployment configuration of controllers that govern registration and work distribution for attached Klusterlets.", @@ -131,10 +122,19 @@ func (NodePlacement) SwaggerDoc() map[string]string { return map_NodePlacement } +var map_RegistrationDriverHub = map[string]string{ + "authType": "Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa.", + "hubClusterArn": "This represents the hub cluster ARN", +} + +func (RegistrationDriverHub) SwaggerDoc() map[string]string { + return map_RegistrationDriverHub +} + var map_RegistrationHubConfiguration = map[string]string{ - "autoApproveUsers": "AutoApproveUser represents a list of users that can auto approve CSR and accept client. If the credential of the bootstrap-hub-kubeconfig matches to the users, the cluster created by the bootstrap-hub-kubeconfig will be auto-registered into the hub cluster. This takes effect only when ManagedClusterAutoApproval feature gate is enabled.", - "featureGates": "FeatureGates represents the list of feature gates for registration If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", - "authDrivers": "AuthDrivers represent the list of authentication drivers for registration An AuthDriver helps to specify the type of authentication to be supported by the hub", + "autoApproveUsers": "AutoApproveUser represents a list of users that can auto approve CSR and accept client. If the credential of the bootstrap-hub-kubeconfig matches to the users, the cluster created by the bootstrap-hub-kubeconfig will be auto-registered into the hub cluster. This takes effect only when ManagedClusterAutoApproval feature gate is enabled.", + "featureGates": "FeatureGates represents the list of feature gates for registration If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates:\n 1. If featuregate/Foo does not exist, registration-operator will discard it\n 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]\n 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,\n \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.", + "registrationDrivers": "RegistrationDrivers represent the list of hub registration drivers that contain information used by hub to initialize the hub cluster A RegistrationDriverHub contains details of authentication type and the hub cluster ARN", } func (RegistrationHubConfiguration) SwaggerDoc() map[string]string { From 3eaf176ba70b65d1b803041ff90fb4f301ecb110 Mon Sep 17 00:00:00 2001 From: Amrutha Date: Wed, 8 Jan 2025 11:29:19 -0500 Subject: [PATCH 7/8] Adding generated crd file Signed-off-by: Amrutha --- ...ter-management.io_clustermanagers.crd.yaml | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) 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 6823d25e9..d4b39b26e 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 @@ -255,18 +255,25 @@ spec: - feature type: object type: array - registrationDriverHub: - description: This provides details to initialize Hub cluster - properties: - authType: - default: csr - description: Type of the authentication used by hub to initialize - the Hub cluster. Possible values are csr and awsirsa. - enum: - - csr - - awsirsa - type: string - type: object + registrationDrivers: + description: |- + RegistrationDrivers represent the list of hub registration drivers that contain information used by hub to initialize the hub cluster + A RegistrationDriverHub contains details of authentication type and the hub cluster ARN + items: + properties: + authType: + default: csr + description: Type of the authentication used by hub to initialize + the Hub cluster. Possible values are csr and awsirsa. + enum: + - csr + - awsirsa + type: string + hubClusterArn: + description: This represents the hub cluster ARN + type: string + type: object + type: array type: object registrationImagePullSpec: default: quay.io/open-cluster-management/registration From 2c57e6fc9b5999403a79b5a9d291d9e04cfaf520 Mon Sep 17 00:00:00 2001 From: Amrutha Date: Thu, 9 Jan 2025 10:34:38 -0500 Subject: [PATCH 8/8] Adding listType and listMapKey annotations Signed-off-by: Amrutha --- ...perator.open-cluster-management.io_clustermanagers.crd.yaml | 3 +++ operator/v1/types_clustermanager.go | 2 ++ 2 files changed, 5 insertions(+) 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 d4b39b26e..d10919170 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 @@ -274,6 +274,9 @@ spec: type: string type: object type: array + x-kubernetes-list-map-keys: + - authType + x-kubernetes-list-type: map type: object registrationImagePullSpec: default: quay.io/open-cluster-management/registration diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 83680a76f..9dee20882 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -112,6 +112,8 @@ type RegistrationHubConfiguration struct { // RegistrationDrivers represent the list of hub registration drivers that contain information used by hub to initialize the hub cluster // A RegistrationDriverHub contains details of authentication type and the hub cluster ARN // +optional + // +listType=map + // +listMapKey=authType RegistrationDrivers []RegistrationDriverHub `json:"registrationDrivers,omitempty"` }