Skip to content

Commit 44f0a0d

Browse files
Merge pull request #5964 from flavianmissi/backport-capabilities
[release-4.18] ARO-15695, OCPBUGS-54625: backport capabilities api
2 parents 6817db8 + 9099ab6 commit 44f0a0d

File tree

94 files changed

+5176
-219
lines changed

Some content is hidden

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

94 files changed

+5176
-219
lines changed

api/hypershift/v1beta1/featuregates/featureGate-Hypershift-Default.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
},
2424
{
2525
"name": "HCPPodsLabels"
26+
},
27+
{
28+
"name": "DisableClusterCapabilities"
2629
}
2730
],
2831
"enabled": [
@@ -42,4 +45,4 @@
4245
}
4346
]
4447
}
45-
}
48+
}

api/hypershift/v1beta1/featuregates/featureGate-Hypershift-TechPreviewNoUpgrade.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
},
3434
{
3535
"name": "HCPPodsLabels"
36+
},
37+
{
38+
"name": "DisableClusterCapabilities"
3639
}
3740
],
3841
"version": ""

api/hypershift/v1beta1/featuregates/featureGate-SelfManagedHA-Default.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
},
2424
{
2525
"name": "HCPPodsLabels"
26+
},
27+
{
28+
"name": "DisableClusterCapabilities"
2629
}
2730
],
2831
"enabled": [
@@ -42,4 +45,4 @@
4245
}
4346
]
4447
}
45-
}
48+
}

api/hypershift/v1beta1/featuregates/featureGate-SelfManagedHA-TechPreviewNoUpgrade.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
},
3434
{
3535
"name": "HCPPodsLabels"
36+
},
37+
{
38+
"name": "DisableClusterCapabilities"
3639
}
3740
],
3841
"version": ""

api/hypershift/v1beta1/hosted_controlplane.go

+8
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ type HostedControlPlaneSpec struct {
196196
// +kubebuilder:validation:MaxProperties=20
197197
// +optional
198198
Labels map[string]string `json:"labels,omitempty"`
199+
200+
// capabilities allows for disabling optional components at cluster install time.
201+
// This field is optional and once set cannot be changed.
202+
// +immutable
203+
// +optional
204+
// +kubebuilder:default={}
205+
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Capabilities is immutable. Changes might result in unpredictable and disruptive behavior."
206+
Capabilities *Capabilities `json:"capabilities,omitempty"`
199207
}
200208

201209
// availabilityPolicy specifies a high level availability policy for components.

api/hypershift/v1beta1/hostedcluster_types.go

+32
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,30 @@ const (
349349
ControlPlaneOperatorV2EnvVar = "CPO_V2"
350350
)
351351

352+
// +kubebuilder:validation:Enum=ImageRegistry
353+
type OptionalCapability string
354+
355+
const ImageRegistryCapability OptionalCapability = OptionalCapability(configv1.ClusterVersionCapabilityImageRegistry)
356+
357+
// capabilities allows disabling optional components at install time.
358+
// Once set, it cannot be changed.
359+
type Capabilities struct {
360+
// disabled when specified, sets the cluster version baselineCapabilitySet to None
361+
// and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
362+
// This effectively disables that capability on the hosted cluster.
363+
//
364+
// When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
365+
// OpenShift version.
366+
//
367+
// Once set, this field cannot be changed.
368+
//
369+
// +listType=atomic
370+
// +immutable
371+
// +optional
372+
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Disabled is immutable. Changes might result in unpredictable and disruptive behavior."
373+
Disabled []OptionalCapability `json:"disabled,omitempty"`
374+
}
375+
352376
// HostedClusterSpec is the desired behavior of a HostedCluster.
353377

354378
// +kubebuilder:validation:XValidation:rule="self.platform.type == 'IBMCloud' ? size(self.services) >= 3 : size(self.services) >= 4",message="spec.services in body should have at least 4 items or 3 for IBMCloud"
@@ -625,6 +649,14 @@ type HostedClusterSpec struct {
625649
// +optional
626650
// +openshift:enable:FeatureGate=HCPPodsLabels
627651
Labels map[string]string `json:"labels,omitempty"`
652+
653+
// capabilities allows for disabling optional components at cluster install time.
654+
// This field is optional and once set cannot be changed.
655+
// +immutable
656+
// +optional
657+
// +kubebuilder:default={}
658+
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Capabilities is immutable. Changes might result in unpredictable and disruptive behavior."
659+
Capabilities *Capabilities `json:"capabilities,omitempty"`
628660
}
629661

630662
// OLMCatalogPlacement is an enum specifying the placement of OLM catalog components.

api/hypershift/v1beta1/zz_generated.deepcopy.go

+30
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

+31
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,37 @@ spec:
149149
format: int32
150150
type: integer
151151
type: object
152+
capabilities:
153+
default: {}
154+
description: |-
155+
capabilities allows for disabling optional components at cluster install time.
156+
This field is optional and once set cannot be changed.
157+
properties:
158+
disabled:
159+
description: |-
160+
disabled when specified, sets the cluster version baselineCapabilitySet to None
161+
and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
162+
This effectively disables that capability on the hosted cluster.
163+
164+
When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
165+
OpenShift version.
166+
167+
Once set, this field cannot be changed.
168+
items:
169+
enum:
170+
- ImageRegistry
171+
type: string
172+
type: array
173+
x-kubernetes-list-type: atomic
174+
x-kubernetes-validations:
175+
- message: Disabled is immutable. Changes might result in unpredictable
176+
and disruptive behavior.
177+
rule: self == oldSelf
178+
type: object
179+
x-kubernetes-validations:
180+
- message: Capabilities is immutable. Changes might result in unpredictable
181+
and disruptive behavior.
182+
rule: self == oldSelf
152183
channel:
153184
description: |-
154185
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/AROHCPManagedIdentities.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,37 @@ spec:
149149
format: int32
150150
type: integer
151151
type: object
152+
capabilities:
153+
default: {}
154+
description: |-
155+
capabilities allows for disabling optional components at cluster install time.
156+
This field is optional and once set cannot be changed.
157+
properties:
158+
disabled:
159+
description: |-
160+
disabled when specified, sets the cluster version baselineCapabilitySet to None
161+
and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
162+
This effectively disables that capability on the hosted cluster.
163+
164+
When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
165+
OpenShift version.
166+
167+
Once set, this field cannot be changed.
168+
items:
169+
enum:
170+
- ImageRegistry
171+
type: string
172+
type: array
173+
x-kubernetes-list-type: atomic
174+
x-kubernetes-validations:
175+
- message: Disabled is immutable. Changes might result in unpredictable
176+
and disruptive behavior.
177+
rule: self == oldSelf
178+
type: object
179+
x-kubernetes-validations:
180+
- message: Capabilities is immutable. Changes might result in unpredictable
181+
and disruptive behavior.
182+
rule: self == oldSelf
152183
channel:
153184
description: |-
154185
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

+31
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,37 @@ spec:
149149
format: int32
150150
type: integer
151151
type: object
152+
capabilities:
153+
default: {}
154+
description: |-
155+
capabilities allows for disabling optional components at cluster install time.
156+
This field is optional and once set cannot be changed.
157+
properties:
158+
disabled:
159+
description: |-
160+
disabled when specified, sets the cluster version baselineCapabilitySet to None
161+
and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
162+
This effectively disables that capability on the hosted cluster.
163+
164+
When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
165+
OpenShift version.
166+
167+
Once set, this field cannot be changed.
168+
items:
169+
enum:
170+
- ImageRegistry
171+
type: string
172+
type: array
173+
x-kubernetes-list-type: atomic
174+
x-kubernetes-validations:
175+
- message: Disabled is immutable. Changes might result in unpredictable
176+
and disruptive behavior.
177+
rule: self == oldSelf
178+
type: object
179+
x-kubernetes-validations:
180+
- message: Capabilities is immutable. Changes might result in unpredictable
181+
and disruptive behavior.
182+
rule: self == oldSelf
152183
channel:
153184
description: |-
154185
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/ExternalOIDC.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,37 @@ spec:
149149
format: int32
150150
type: integer
151151
type: object
152+
capabilities:
153+
default: {}
154+
description: |-
155+
capabilities allows for disabling optional components at cluster install time.
156+
This field is optional and once set cannot be changed.
157+
properties:
158+
disabled:
159+
description: |-
160+
disabled when specified, sets the cluster version baselineCapabilitySet to None
161+
and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
162+
This effectively disables that capability on the hosted cluster.
163+
164+
When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
165+
OpenShift version.
166+
167+
Once set, this field cannot be changed.
168+
items:
169+
enum:
170+
- ImageRegistry
171+
type: string
172+
type: array
173+
x-kubernetes-list-type: atomic
174+
x-kubernetes-validations:
175+
- message: Disabled is immutable. Changes might result in unpredictable
176+
and disruptive behavior.
177+
rule: self == oldSelf
178+
type: object
179+
x-kubernetes-validations:
180+
- message: Capabilities is immutable. Changes might result in unpredictable
181+
and disruptive behavior.
182+
rule: self == oldSelf
152183
channel:
153184
description: |-
154185
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/HCPPodsLabels.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,37 @@ spec:
149149
format: int32
150150
type: integer
151151
type: object
152+
capabilities:
153+
default: {}
154+
description: |-
155+
capabilities allows for disabling optional components at cluster install time.
156+
This field is optional and once set cannot be changed.
157+
properties:
158+
disabled:
159+
description: |-
160+
disabled when specified, sets the cluster version baselineCapabilitySet to None
161+
and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
162+
This effectively disables that capability on the hosted cluster.
163+
164+
When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
165+
OpenShift version.
166+
167+
Once set, this field cannot be changed.
168+
items:
169+
enum:
170+
- ImageRegistry
171+
type: string
172+
type: array
173+
x-kubernetes-list-type: atomic
174+
x-kubernetes-validations:
175+
- message: Disabled is immutable. Changes might result in unpredictable
176+
and disruptive behavior.
177+
rule: self == oldSelf
178+
type: object
179+
x-kubernetes-validations:
180+
- message: Capabilities is immutable. Changes might result in unpredictable
181+
and disruptive behavior.
182+
rule: self == oldSelf
152183
channel:
153184
description: |-
154185
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/NetworkDiagnosticsConfig.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,37 @@ spec:
149149
format: int32
150150
type: integer
151151
type: object
152+
capabilities:
153+
default: {}
154+
description: |-
155+
capabilities allows for disabling optional components at cluster install time.
156+
This field is optional and once set cannot be changed.
157+
properties:
158+
disabled:
159+
description: |-
160+
disabled when specified, sets the cluster version baselineCapabilitySet to None
161+
and sets all additionalEnabledCapabilities BUT the ones supplied in disabled.
162+
This effectively disables that capability on the hosted cluster.
163+
164+
When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
165+
OpenShift version.
166+
167+
Once set, this field cannot be changed.
168+
items:
169+
enum:
170+
- ImageRegistry
171+
type: string
172+
type: array
173+
x-kubernetes-list-type: atomic
174+
x-kubernetes-validations:
175+
- message: Disabled is immutable. Changes might result in unpredictable
176+
and disruptive behavior.
177+
rule: self == oldSelf
178+
type: object
179+
x-kubernetes-validations:
180+
- message: Capabilities is immutable. Changes might result in unpredictable
181+
and disruptive behavior.
182+
rule: self == oldSelf
152183
channel:
153184
description: |-
154185
channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster.

0 commit comments

Comments
 (0)