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 acd44f13e..ec7dabab5 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 @@ -251,6 +251,24 @@ spec: ClusterAnnotations is annotations with the reserve prefix "agent.open-cluster-management.io" set on ManagedCluster when creating only, other actors can update it afterwards. type: object + clusterClaimConfiguration: + description: |- + ClusterClaimConfiguration represents the configuration of ClusterClaim + Effective only when the `ClusterClaim` feature gate is enabled. + properties: + maxCustomClusterClaims: + default: 20 + description: Maximum number of custom ClusterClaims allowed. + format: int32 + type: integer + reservedClusterClaimSuffixes: + description: Custom suffixes for reserved ClusterClaims. + items: + type: string + type: array + required: + - maxCustomClusterClaims + type: object featureGates: description: "FeatureGates represents the list of feature gates for registration\nIf it is set empty, default feature gates diff --git a/operator/v1/types_klusterlet.go b/operator/v1/types_klusterlet.go index 524b350d3..706db8901 100644 --- a/operator/v1/types_klusterlet.go +++ b/operator/v1/types_klusterlet.go @@ -176,6 +176,24 @@ type RegistrationConfiguration struct { // This provides driver details required to register with hub // +optional RegistrationDriver RegistrationDriver `json:"registrationDriver,omitempty"` + + // ClusterClaimConfiguration represents the configuration of ClusterClaim + // Effective only when the `ClusterClaim` feature gate is enabled. + // +optional + ClusterClaimConfiguration *ClusterClaimConfiguration `json:"clusterClaimConfiguration,omitempty"` +} + +// ClusterClaimConfiguration represents the configuration of ClusterClaim +type ClusterClaimConfiguration struct { + // Maximum number of custom ClusterClaims allowed. + // +kubebuilder:validation:Required + // +kubebuilder:default:=20 + // +required + MaxCustomClusterClaims int32 `json:"maxCustomClusterClaims"` + + // Custom suffixes for reserved ClusterClaims. + // +optional + ReservedClusterClaimSuffixes []string `json:"reservedClusterClaimSuffixes,omitempty"` } type RegistrationDriver struct { diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 1cfb0760a..240612641 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -116,6 +116,27 @@ func (in *CSRConfig) DeepCopy() *CSRConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClaimConfiguration) DeepCopyInto(out *ClusterClaimConfiguration) { + *out = *in + if in.ReservedClusterClaimSuffixes != nil { + in, out := &in.ReservedClusterClaimSuffixes, &out.ReservedClusterClaimSuffixes + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClaimConfiguration. +func (in *ClusterClaimConfiguration) DeepCopy() *ClusterClaimConfiguration { + if in == nil { + return nil + } + out := new(ClusterClaimConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterManager) DeepCopyInto(out *ClusterManager) { *out = *in @@ -574,6 +595,11 @@ func (in *RegistrationConfiguration) DeepCopyInto(out *RegistrationConfiguration } in.BootstrapKubeConfigs.DeepCopyInto(&out.BootstrapKubeConfigs) in.RegistrationDriver.DeepCopyInto(&out.RegistrationDriver) + if in.ClusterClaimConfiguration != nil { + in, out := &in.ClusterClaimConfiguration, &out.ClusterClaimConfiguration + *out = new(ClusterClaimConfiguration) + (*in).DeepCopyInto(*out) + } return } diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index d2308a0b5..1c56a8551 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -210,6 +210,16 @@ func (BootstrapKubeConfigs) SwaggerDoc() map[string]string { return map_BootstrapKubeConfigs } +var map_ClusterClaimConfiguration = map[string]string{ + "": "ClusterClaimConfiguration represents the configuration of ClusterClaim", + "maxCustomClusterClaims": "Maximum number of custom ClusterClaims allowed.", + "reservedClusterClaimSuffixes": "Custom suffixes for reserved ClusterClaims.", +} + +func (ClusterClaimConfiguration) SwaggerDoc() map[string]string { + return map_ClusterClaimConfiguration +} + var map_HubApiServerHostAlias = map[string]string{ "": "HubApiServerHostAlias holds the mapping between IP and hostname that will be injected as an entry in the pod's hosts file.", "ip": "IP address of the host file entry.", @@ -307,6 +317,7 @@ var map_RegistrationConfiguration = map[string]string{ "kubeAPIBurst": "KubeAPIBurst indicates the maximum burst of the throttle while talking with apiserver of hub cluster from the spoke cluster. If it is set empty, use the default value: 100", "bootstrapKubeConfigs": "BootstrapKubeConfigs defines the ordered list of bootstrap kubeconfigs. The order decides which bootstrap kubeconfig to use first when rebootstrap.\n\nWhen the agent loses the connection to the current hub over HubConnectionTimeoutSeconds, or the managedcluster CR is set `hubAcceptsClient=false` on the hub, the controller marks the related bootstrap kubeconfig as \"failed\".\n\nA failed bootstrapkubeconfig won't be used for the duration specified by SkipFailedBootstrapKubeConfigSeconds. But if the user updates the content of a failed bootstrapkubeconfig, the \"failed\" mark will be cleared.", "registrationDriver": "This provides driver details required to register with hub", + "clusterClaimConfiguration": "ClusterClaimConfiguration represents the configuration of ClusterClaim Effective only when the `ClusterClaim` feature gate is enabled.", } func (RegistrationConfiguration) SwaggerDoc() map[string]string {