Skip to content

Commit 3185737

Browse files
committed
Allow enabling capabilities, and make baremetal capability disabled/opt-in by default on hosted clusters
1 parent a203d81 commit 3185737

File tree

43 files changed

+1630
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1630
-88
lines changed

api/hypershift/v1beta1/hostedcluster_types.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,24 @@ const (
369369
PruneRetentionPolicy RetentionPolicy = "Prune"
370370
)
371371

372-
// +kubebuilder:validation:Enum=ImageRegistry
373-
type OptionalCapability string
374-
375-
const ImageRegistryCapability OptionalCapability = OptionalCapability(configv1.ClusterVersionCapabilityImageRegistry)
376-
377-
// capabilities allows disabling optional components at install time.
372+
// capabilities allows enabing or disabling optional components at install time.
378373
// Once set, it cannot be changed.
374+
// self.set1.all(e, !(e in self.set2)),
375+
//
376+
// +kubebuilder:validation:XValidation:rule="self.enabled.all(e, !(e in self.disabled))", message="Capabilities can not be both enabled and disabled at once."
379377
type Capabilities struct {
378+
// enabled when specified, explicitly enables a capability on a hosted cluster. These capabilities are added after the disabled capabilities have been
379+
// removed from the default set of capabilities: so the overall result is Default - Disabled + Enabled.
380+
//
381+
// Once set, this field cannot be changed.
382+
//
383+
// +listType=atomic
384+
// +immutable
385+
// +optional
386+
// +kubebuilder:validation:MaxItems=25
387+
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Enabled is immutable. Changes might result in unpredictable and disruptive behavior."
388+
Enabled []configv1.ClusterVersionCapability `json:"enabled,omitempty"`
389+
380390
// disabled when specified, sets the cluster version baselineCapabilitySet to None
381391
// and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
382392
// This effectively disables that capability on the hosted cluster.
@@ -391,7 +401,7 @@ type Capabilities struct {
391401
// +optional
392402
// +kubebuilder:validation:MaxItems=25
393403
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Disabled is immutable. Changes might result in unpredictable and disruptive behavior."
394-
Disabled []OptionalCapability `json:"disabled,omitempty"`
404+
Disabled []configv1.ClusterVersionCapability `json:"disabled,omitempty"`
395405
}
396406

397407
// HostedClusterSpec is the desired behavior of a HostedCluster.

api/hypershift/v1beta1/zz_generated.deepcopy.go

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,26 @@ spec:
167167
168168
Once set, this field cannot be changed.
169169
items:
170+
description: ClusterVersionCapability enumerates optional, core
171+
cluster components.
170172
enum:
173+
- openshift-samples
174+
- baremetal
175+
- marketplace
176+
- Console
177+
- Insights
178+
- Storage
179+
- CSISnapshot
180+
- NodeTuning
181+
- MachineAPI
182+
- Build
183+
- DeploymentConfig
171184
- ImageRegistry
185+
- OperatorLifecycleManager
186+
- CloudCredential
187+
- Ingress
188+
- CloudControllerManager
189+
- OperatorLifecycleManagerV1
172190
type: string
173191
maxItems: 25
174192
type: array
@@ -177,11 +195,48 @@ spec:
177195
- message: Disabled is immutable. Changes might result in unpredictable
178196
and disruptive behavior.
179197
rule: self == oldSelf
198+
enabled:
199+
description: |-
200+
enabled when specified, explicitly enables a capability on a hosted cluster. These capabilities are added after the disabled capabilities have been
201+
removed from the default set of capabilities: so the overall result is Default - Disabled + Enabled.
202+
203+
Once set, this field cannot be changed.
204+
items:
205+
description: ClusterVersionCapability enumerates optional, core
206+
cluster components.
207+
enum:
208+
- openshift-samples
209+
- baremetal
210+
- marketplace
211+
- Console
212+
- Insights
213+
- Storage
214+
- CSISnapshot
215+
- NodeTuning
216+
- MachineAPI
217+
- Build
218+
- DeploymentConfig
219+
- ImageRegistry
220+
- OperatorLifecycleManager
221+
- CloudCredential
222+
- Ingress
223+
- CloudControllerManager
224+
- OperatorLifecycleManagerV1
225+
type: string
226+
maxItems: 25
227+
type: array
228+
x-kubernetes-list-type: atomic
229+
x-kubernetes-validations:
230+
- message: Enabled is immutable. Changes might result in unpredictable
231+
and disruptive behavior.
232+
rule: self == oldSelf
180233
type: object
181234
x-kubernetes-validations:
182235
- message: Capabilities is immutable. Changes might result in unpredictable
183236
and disruptive behavior.
184237
rule: self == oldSelf
238+
- message: Capabilities can not be both enabled and disabled at once.
239+
rule: self.enabled.all(e, !(e in self.disabled))
185240
channel:
186241
description: |-
187242
channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster.

api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,26 @@ spec:
214214
215215
Once set, this field cannot be changed.
216216
items:
217+
description: ClusterVersionCapability enumerates optional, core
218+
cluster components.
217219
enum:
220+
- openshift-samples
221+
- baremetal
222+
- marketplace
223+
- Console
224+
- Insights
225+
- Storage
226+
- CSISnapshot
227+
- NodeTuning
228+
- MachineAPI
229+
- Build
230+
- DeploymentConfig
218231
- ImageRegistry
232+
- OperatorLifecycleManager
233+
- CloudCredential
234+
- Ingress
235+
- CloudControllerManager
236+
- OperatorLifecycleManagerV1
219237
type: string
220238
maxItems: 25
221239
type: array
@@ -224,11 +242,48 @@ spec:
224242
- message: Disabled is immutable. Changes might result in unpredictable
225243
and disruptive behavior.
226244
rule: self == oldSelf
245+
enabled:
246+
description: |-
247+
enabled when specified, explicitly enables a capability on a hosted cluster. These capabilities are added after the disabled capabilities have been
248+
removed from the default set of capabilities: so the overall result is Default - Disabled + Enabled.
249+
250+
Once set, this field cannot be changed.
251+
items:
252+
description: ClusterVersionCapability enumerates optional, core
253+
cluster components.
254+
enum:
255+
- openshift-samples
256+
- baremetal
257+
- marketplace
258+
- Console
259+
- Insights
260+
- Storage
261+
- CSISnapshot
262+
- NodeTuning
263+
- MachineAPI
264+
- Build
265+
- DeploymentConfig
266+
- ImageRegistry
267+
- OperatorLifecycleManager
268+
- CloudCredential
269+
- Ingress
270+
- CloudControllerManager
271+
- OperatorLifecycleManagerV1
272+
type: string
273+
maxItems: 25
274+
type: array
275+
x-kubernetes-list-type: atomic
276+
x-kubernetes-validations:
277+
- message: Enabled is immutable. Changes might result in unpredictable
278+
and disruptive behavior.
279+
rule: self == oldSelf
227280
type: object
228281
x-kubernetes-validations:
229282
- message: Capabilities is immutable. Changes might result in unpredictable
230283
and disruptive behavior.
231284
rule: self == oldSelf
285+
- message: Capabilities can not be both enabled and disabled at once.
286+
rule: self.enabled.all(e, !(e in self.disabled))
232287
channel:
233288
description: |-
234289
channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster.

api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,26 @@ spec:
167167
168168
Once set, this field cannot be changed.
169169
items:
170+
description: ClusterVersionCapability enumerates optional, core
171+
cluster components.
170172
enum:
173+
- openshift-samples
174+
- baremetal
175+
- marketplace
176+
- Console
177+
- Insights
178+
- Storage
179+
- CSISnapshot
180+
- NodeTuning
181+
- MachineAPI
182+
- Build
183+
- DeploymentConfig
171184
- ImageRegistry
185+
- OperatorLifecycleManager
186+
- CloudCredential
187+
- Ingress
188+
- CloudControllerManager
189+
- OperatorLifecycleManagerV1
172190
type: string
173191
maxItems: 25
174192
type: array
@@ -177,11 +195,48 @@ spec:
177195
- message: Disabled is immutable. Changes might result in unpredictable
178196
and disruptive behavior.
179197
rule: self == oldSelf
198+
enabled:
199+
description: |-
200+
enabled when specified, explicitly enables a capability on a hosted cluster. These capabilities are added after the disabled capabilities have been
201+
removed from the default set of capabilities: so the overall result is Default - Disabled + Enabled.
202+
203+
Once set, this field cannot be changed.
204+
items:
205+
description: ClusterVersionCapability enumerates optional, core
206+
cluster components.
207+
enum:
208+
- openshift-samples
209+
- baremetal
210+
- marketplace
211+
- Console
212+
- Insights
213+
- Storage
214+
- CSISnapshot
215+
- NodeTuning
216+
- MachineAPI
217+
- Build
218+
- DeploymentConfig
219+
- ImageRegistry
220+
- OperatorLifecycleManager
221+
- CloudCredential
222+
- Ingress
223+
- CloudControllerManager
224+
- OperatorLifecycleManagerV1
225+
type: string
226+
maxItems: 25
227+
type: array
228+
x-kubernetes-list-type: atomic
229+
x-kubernetes-validations:
230+
- message: Enabled is immutable. Changes might result in unpredictable
231+
and disruptive behavior.
232+
rule: self == oldSelf
180233
type: object
181234
x-kubernetes-validations:
182235
- message: Capabilities is immutable. Changes might result in unpredictable
183236
and disruptive behavior.
184237
rule: self == oldSelf
238+
- message: Capabilities can not be both enabled and disabled at once.
239+
rule: self.enabled.all(e, !(e in self.disabled))
185240
channel:
186241
description: |-
187242
channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster.

api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/DynamicResourceAllocation.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,26 @@ spec:
167167
168168
Once set, this field cannot be changed.
169169
items:
170+
description: ClusterVersionCapability enumerates optional, core
171+
cluster components.
170172
enum:
173+
- openshift-samples
174+
- baremetal
175+
- marketplace
176+
- Console
177+
- Insights
178+
- Storage
179+
- CSISnapshot
180+
- NodeTuning
181+
- MachineAPI
182+
- Build
183+
- DeploymentConfig
171184
- ImageRegistry
185+
- OperatorLifecycleManager
186+
- CloudCredential
187+
- Ingress
188+
- CloudControllerManager
189+
- OperatorLifecycleManagerV1
172190
type: string
173191
maxItems: 25
174192
type: array
@@ -177,11 +195,48 @@ spec:
177195
- message: Disabled is immutable. Changes might result in unpredictable
178196
and disruptive behavior.
179197
rule: self == oldSelf
198+
enabled:
199+
description: |-
200+
enabled when specified, explicitly enables a capability on a hosted cluster. These capabilities are added after the disabled capabilities have been
201+
removed from the default set of capabilities: so the overall result is Default - Disabled + Enabled.
202+
203+
Once set, this field cannot be changed.
204+
items:
205+
description: ClusterVersionCapability enumerates optional, core
206+
cluster components.
207+
enum:
208+
- openshift-samples
209+
- baremetal
210+
- marketplace
211+
- Console
212+
- Insights
213+
- Storage
214+
- CSISnapshot
215+
- NodeTuning
216+
- MachineAPI
217+
- Build
218+
- DeploymentConfig
219+
- ImageRegistry
220+
- OperatorLifecycleManager
221+
- CloudCredential
222+
- Ingress
223+
- CloudControllerManager
224+
- OperatorLifecycleManagerV1
225+
type: string
226+
maxItems: 25
227+
type: array
228+
x-kubernetes-list-type: atomic
229+
x-kubernetes-validations:
230+
- message: Enabled is immutable. Changes might result in unpredictable
231+
and disruptive behavior.
232+
rule: self == oldSelf
180233
type: object
181234
x-kubernetes-validations:
182235
- message: Capabilities is immutable. Changes might result in unpredictable
183236
and disruptive behavior.
184237
rule: self == oldSelf
238+
- message: Capabilities can not be both enabled and disabled at once.
239+
rule: self.enabled.all(e, !(e in self.disabled))
185240
channel:
186241
description: |-
187242
channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster.

0 commit comments

Comments
 (0)