@@ -17,6 +17,8 @@ type ClusterManager struct {
17
17
metav1.ObjectMeta `json:"metadata,omitempty"`
18
18
19
19
// Spec represents a desired deployment configuration of controllers that govern registration and work distribution for attached Klusterlets.
20
+ // +kubebuilder:validation:Required
21
+ // +required
20
22
Spec ClusterManagerSpec `json:"spec"`
21
23
22
24
// Status represents the current status of controllers that govern the lifecycle of managed clusters.
@@ -138,7 +140,9 @@ type Klusterlet struct {
138
140
metav1.ObjectMeta `json:"metadata,omitempty"`
139
141
140
142
// Spec represents the desired deployment configuration of Klusterlet agent.
141
- Spec KlusterletSpec `json:"spec,omitempty"`
143
+ // +kubebuilder:validation:Required
144
+ // +required
145
+ Spec KlusterletSpec `json:"spec"`
142
146
143
147
// Status represents the current status of Klusterlet agent.
144
148
Status KlusterletStatus `json:"status,omitempty"`
@@ -150,6 +154,8 @@ type KlusterletSpec struct {
150
154
// The namespace must have a prefix of "open-cluster-management-", and if it is not set,
151
155
// the namespace of "open-cluster-management-agent" is used to deploy agent.
152
156
// +optional
157
+ // +kubebuilder:validation:MaxLength=63
158
+ // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
153
159
Namespace string `json:"namespace,omitempty"`
154
160
155
161
// RegistrationImagePullSpec represents the desired image configuration of registration agent.
@@ -163,6 +169,8 @@ type KlusterletSpec struct {
163
169
// ClusterName is the name of the managed cluster to be created on hub.
164
170
// The Klusterlet agent generates a random name if it is not set, or discovers the appropriate cluster name on OpenShift.
165
171
// +optional
172
+ // +kubebuilder:validation:MaxLength=63
173
+ // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
166
174
ClusterName string `json:"clusterName,omitempty"`
167
175
168
176
// ExternalServerURLs represents the a list of apiserver urls and ca bundles that is accessible externally
0 commit comments