Skip to content

Commit 3297cac

Browse files
authored
Fix webhook configuration to pointer (#138)
Signed-off-by: xuezhaojun <[email protected]>
1 parent 280cf8e commit 3297cac

6 files changed

+122
-49
lines changed

operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,42 @@ spec:
4141
required:
4242
- mode
4343
properties:
44+
detached:
45+
description: Detached includes configurations we needs for clustermanager in the detached mode.
46+
type: object
47+
properties:
48+
registrationWebhookConfiguration:
49+
description: RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
50+
type: object
51+
required:
52+
- address
53+
properties:
54+
address:
55+
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.
56+
type: string
57+
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])$
58+
port:
59+
description: Port represents the port of a webhook-server. The default value of Port is 443.
60+
type: integer
61+
format: int32
62+
default: 443
63+
maximum: 65535
64+
workWebhookConfiguration:
65+
description: WorkWebhookConfiguration represents the customized webhook-server configuration of work.
66+
type: object
67+
required:
68+
- address
69+
properties:
70+
address:
71+
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.
72+
type: string
73+
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])$
74+
port:
75+
description: Port represents the port of a webhook-server. The default value of Port is 443.
76+
type: integer
77+
format: int32
78+
default: 443
79+
maximum: 65535
4480
mode:
4581
description: "Mode can be Default or Detached. For cluster-manager: - In Default mode, the Hub is installed as a whole and all parts of Hub are deployed in the same cluster. - 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). For klusterlet: - In Default mode, all klusterlet related resources are deployed on the managed cluster. - 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). The 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 Note: Do not modify the Mode field once it's applied."
4682
type: string

operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

+36-38
Original file line numberDiff line numberDiff line change
@@ -33,54 +33,52 @@ spec:
3333
deployOption:
3434
description: DeployOption contains the options of deploying a cluster-manager Default mode is used if DeployOption is not set.
3535
type: object
36-
default:
37-
mode: Default
3836
required:
3937
- mode
4038
properties:
39+
detached:
40+
description: Detached includes configurations we needs for clustermanager in the detached mode.
41+
type: object
42+
properties:
43+
registrationWebhookConfiguration:
44+
description: RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
45+
type: object
46+
required:
47+
- address
48+
properties:
49+
address:
50+
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.
51+
type: string
52+
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])$
53+
port:
54+
description: Port represents the port of a webhook-server. The default value of Port is 443.
55+
type: integer
56+
format: int32
57+
default: 443
58+
maximum: 65535
59+
workWebhookConfiguration:
60+
description: WorkWebhookConfiguration represents the customized webhook-server configuration of work.
61+
type: object
62+
required:
63+
- address
64+
properties:
65+
address:
66+
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.
67+
type: string
68+
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])$
69+
port:
70+
description: Port represents the port of a webhook-server. The default value of Port is 443.
71+
type: integer
72+
format: int32
73+
default: 443
74+
maximum: 65535
4175
mode:
4276
description: "Mode can be Default or Detached. For cluster-manager: - In Default mode, the Hub is installed as a whole and all parts of Hub are deployed in the same cluster. - 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). For klusterlet: - In Default mode, all klusterlet related resources are deployed on the managed cluster. - 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). The 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 Note: Do not modify the Mode field once it's applied."
4377
type: string
4478
default: Default
4579
enum:
4680
- Default
4781
- Detached
48-
detached:
49-
description: Detached includes configurations we needs for clustermanager in the detached mode.
50-
type: object
51-
properties:
52-
registrationWebhookConfiguration:
53-
description: RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
54-
type: object
55-
required:
56-
- address
57-
properties:
58-
address:
59-
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.
60-
type: string
61-
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])$
62-
port:
63-
description: Port represents the port of a webhook-server. The default value of Port is 443.
64-
type: integer
65-
format: int32
66-
default: 443
67-
maximum: 65535
68-
workWebhookConfiguration:
69-
description: WorkWebhookConfiguration represents the customized webhook-server configuration of work.
70-
type: object
71-
required:
72-
- address
73-
properties:
74-
address:
75-
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.
76-
type: string
77-
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])$
78-
port:
79-
description: Port represents the port of a webhook-server. The default value of Port is 443.
80-
type: integer
81-
format: int32
82-
default: 443
83-
maximum: 65535
8482
nodePlacement:
8583
description: NodePlacement enables explicit control over the scheduling of the deployed pods.
8684
type: object

operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,42 @@ spec:
4141
required:
4242
- mode
4343
properties:
44+
detached:
45+
description: Detached includes configurations we needs for clustermanager in the detached mode.
46+
type: object
47+
properties:
48+
registrationWebhookConfiguration:
49+
description: RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
50+
type: object
51+
required:
52+
- address
53+
properties:
54+
address:
55+
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.
56+
type: string
57+
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])$
58+
port:
59+
description: Port represents the port of a webhook-server. The default value of Port is 443.
60+
type: integer
61+
format: int32
62+
default: 443
63+
maximum: 65535
64+
workWebhookConfiguration:
65+
description: WorkWebhookConfiguration represents the customized webhook-server configuration of work.
66+
type: object
67+
required:
68+
- address
69+
properties:
70+
address:
71+
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.
72+
type: string
73+
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])$
74+
port:
75+
description: Port represents the port of a webhook-server. The default value of Port is 443.
76+
type: integer
77+
format: int32
78+
default: 443
79+
maximum: 65535
4480
mode:
4581
description: "Mode can be Default or Detached. For cluster-manager: - In Default mode, the Hub is installed as a whole and all parts of Hub are deployed in the same cluster. - 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). For klusterlet: - In Default mode, all klusterlet related resources are deployed on the managed cluster. - 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). The 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 Note: Do not modify the Mode field once it's applied."
4682
type: string

operator/v1/types.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,7 @@ type ClusterManagerSpec struct {
5050
// DeployOption contains the options of deploying a cluster-manager
5151
// Default mode is used if DeployOption is not set.
5252
// +optional
53-
// +kubebuilder:default={mode: Default}
5453
DeployOption DeployOption `json:"deployOption,omitempty"`
55-
56-
// Detached includes configurations we needs for clustermanager in the detached mode.
57-
// +optional
58-
Detached DetachedClusterManagerConfiguration `json:"detached,omitempty"`
5954
}
6055

6156
// DetachedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the detached mode.
@@ -107,6 +102,10 @@ type DeployOption struct {
107102
// +kubebuilder:default=Default
108103
// +kubebuilder:validation:Enum=Default;Detached
109104
Mode InstallMode `json:"mode"`
105+
106+
// Detached includes configurations we needs for clustermanager in the detached mode.
107+
// +optional
108+
Detached *DetachedClusterManagerConfiguration `json:"detached,omitempty"`
110109
}
111110

112111
// InstallMode represents the mode of deploy cluster-manager or klusterlet

operator/v1/zz_generated.deepcopy.go

+7-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/v1/zz_generated.swagger_doc_generated.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)