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..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 @@ -255,6 +255,28 @@ spec: - feature type: object type: array + 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 + 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 373f87f10..9dee20882 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -108,6 +108,26 @@ 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"` + + // 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"` +} + +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"` + + // This represents the hub cluster ARN + // +optional + HubClusterArn string `json:"hubClusterArn,omitempty"` } type WorkConfiguration struct { diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 64a618ba5..96eef484b 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,11 @@ func (in *RegistrationHubConfiguration) DeepCopyInto(out *RegistrationHubConfigu *out = make([]FeatureGate, len(*in)) copy(*out, *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 5d63b9197..fe3a09bd0 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -122,9 +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.", + "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 {