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 17fccb8f5..f376d564c 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 @@ -45,6 +45,42 @@ spec: enum: - Default - Detached + detached: + description: Detached includes configurations we needs for clustermanager in the detached mode. + type: object + properties: + registrationWebhookConfiguration: + description: RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration. + type: object + required: + - address + properties: + address: + description: Address represents the address of a webhook-server. It could be in IP format or fqdn format. The Address must be reachable by apiserver of the hub cluster. + type: string + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$ + port: + description: Port represents the port of a webhook-server. The default value of Port is 443. + type: integer + format: int32 + default: 443 + maximum: 65535 + workWebhookConfiguration: + description: WorkWebhookConfiguration represents the customized webhook-server configuration of work. + type: object + required: + - address + properties: + address: + description: Address represents the address of a webhook-server. It could be in IP format or fqdn format. The Address must be reachable by apiserver of the hub cluster. + type: string + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$ + port: + description: Port represents the port of a webhook-server. The default value of Port is 443. + type: integer + format: int32 + default: 443 + maximum: 65535 nodePlacement: description: NodePlacement enables explicit control over the scheduling of the deployed pods. type: object diff --git a/operator/v1/types.go b/operator/v1/types.go index 0f313ec47..b610cf10d 100644 --- a/operator/v1/types.go +++ b/operator/v1/types.go @@ -52,6 +52,39 @@ type ClusterManagerSpec struct { // +optional // +kubebuilder:default={mode: Default} DeployOption DeployOption `json:"deployOption,omitempty"` + + // Detached includes configurations we needs for clustermanager in the detached mode. + // +optional + Detached DetachedClusterManagerConfiguration `json:"detached,omitempty"` +} + +// DetachedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the detached mode. +type DetachedClusterManagerConfiguration struct { + // RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration. + // +optional + RegistrationWebhookConfiguration WebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"` + + // WorkWebhookConfiguration represents the customized webhook-server configuration of work. + // +optional + WorkWebhookConfiguration WebhookConfiguration `json:"workWebhookConfiguration,omitempty"` +} + +// WebhookConfiguration has two properties: Address and Port. +type WebhookConfiguration struct { + // Address represents the address of a webhook-server. + // It could be in IP format or fqdn format. + // The Address must be reachable by apiserver of the hub cluster. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Pattern=^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$ + Address string `json:"address"` + + // Port represents the port of a webhook-server. The default value of Port is 443. + // +optional + // +default=443 + // +kubebuilder:default=443 + // +kubebuilder:validation:Maximum=65535 + Port int32 `json:"port,omitempty"` } // DeployOption describes the deploy options for cluster-manager or klusterlet diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index ad9060cfd..e87cd0cb9 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -77,6 +77,7 @@ func (in *ClusterManagerSpec) DeepCopyInto(out *ClusterManagerSpec) { *out = *in in.NodePlacement.DeepCopyInto(&out.NodePlacement) out.DeployOption = in.DeployOption + out.Detached = in.Detached return } @@ -139,6 +140,24 @@ func (in *DeployOption) DeepCopy() *DeployOption { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DetachedClusterManagerConfiguration) DeepCopyInto(out *DetachedClusterManagerConfiguration) { + *out = *in + out.RegistrationWebhookConfiguration = in.RegistrationWebhookConfiguration + out.WorkWebhookConfiguration = in.WorkWebhookConfiguration + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DetachedClusterManagerConfiguration. +func (in *DetachedClusterManagerConfiguration) DeepCopy() *DetachedClusterManagerConfiguration { + if in == nil { + return nil + } + out := new(DetachedClusterManagerConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GenerationStatus) DeepCopyInto(out *GenerationStatus) { *out = *in @@ -340,3 +359,19 @@ func (in *ServerURL) DeepCopy() *ServerURL { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfiguration. +func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration { + if in == nil { + return nil + } + out := new(WebhookConfiguration) + in.DeepCopyInto(out) + return out +} diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index c0d748613..7cc72bd5f 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -38,6 +38,7 @@ var map_ClusterManagerSpec = map[string]string{ "placementImagePullSpec": "PlacementImagePullSpec represents the desired image configuration of placement controller/webhook installed on hub.", "nodePlacement": "NodePlacement enables explicit control over the scheduling of the deployed pods.", "deployOption": "DeployOption contains the options of deploying a cluster-manager Default mode is used if DeployOption is not set.", + "detached": "Detached includes configurations we needs for clustermanager in the detached mode.", } func (ClusterManagerSpec) SwaggerDoc() map[string]string { @@ -65,6 +66,16 @@ func (DeployOption) SwaggerDoc() map[string]string { return map_DeployOption } +var map_DetachedClusterManagerConfiguration = map[string]string{ + "": "DetachedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the detached mode.", + "registrationWebhookConfiguration": "RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.", + "workWebhookConfiguration": "WorkWebhookConfiguration represents the customized webhook-server configuration of work.", +} + +func (DetachedClusterManagerConfiguration) SwaggerDoc() map[string]string { + return map_DetachedClusterManagerConfiguration +} + var map_GenerationStatus = map[string]string{ "": "GenerationStatus keeps track of the generation for a given resource so that decisions about forced updates can be made. The definition matches the GenerationStatus defined in github.com/openshift/api/v1", "group": "group is the group of the resource that you're tracking", @@ -159,4 +170,14 @@ func (ServerURL) SwaggerDoc() map[string]string { return map_ServerURL } +var map_WebhookConfiguration = map[string]string{ + "": "WebhookConfiguration has two properties: Address and Port.", + "address": "Address represents the address of a webhook-server. It could be in IP format or fqdn format. The Address must be reachable by apiserver of the hub cluster.", + "port": "Port represents the port of a webhook-server. The default value of Port is 443.", +} + +func (WebhookConfiguration) SwaggerDoc() map[string]string { + return map_WebhookConfiguration +} + // AUTO-GENERATED FUNCTIONS END HERE