Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
{
"name": "OpenStack"
},
{
"name": "DisableClusterCapabilities"
}
],
"enabled": [
# We enable all OCP feature gates only so the CRD contains the fields.
Expand All @@ -42,4 +45,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
{
"name": "OpenStack"
},
{
"name": "DisableClusterCapabilities"
}
],
"version": ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
{
"name": "OpenStack"
},
{
"name": "DisableClusterCapabilities"
}
],
"enabled": [
# We enable all OCP feature gates only so the CRD contains the fields.
Expand All @@ -42,4 +45,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"enabled": [
{
"name": "AutoNodeKarpenter",
},
},
{
"name": "AROHCPManagedIdentities"
},
Expand All @@ -34,6 +34,9 @@
{
"name": "OpenStack"
},
{
"name": "DisableClusterCapabilities"
}
],
"version": ""
}
Expand Down
6 changes: 6 additions & 0 deletions api/hypershift/v1beta1/hosted_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ type HostedControlPlaneSpec struct {
// +kubebuilder:validation:MaxProperties=20
// +optional
Labels map[string]string `json:"labels,omitempty"`

// capabilities allows for disabling optional components at cluster install time.
// This field is optional and once set cannot be changed.
// +optional
// +openshift:enable:FeatureGate=DisableClusterCapabilities
Capabilities *Capabilities `json:"capabilities,omitempty"`
}

// availabilityPolicy specifies a high level availability policy for components.
Expand Down
36 changes: 32 additions & 4 deletions api/hypershift/v1beta1/hostedcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,30 @@ const (
AWSMachinePublicIPs = "hypershift.openshift.io/aws-machine-public-ips"
)

// +kubebuilder:validation:Enum=ImageRegistry
type OptionalCapability string

const ImageRegistryCapability OptionalCapability = OptionalCapability(configv1.ClusterVersionCapabilityImageRegistry)

// capabilities allows disabling optional components at install time.
// Once set, it cannot be changed.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.disabledCapabilities) || has(self.disabledCapabilities)", message="disabledCapabilities is required once set"
type Capabilities struct {
// disabledCapabilities when specified, sets the cluster version baselineCapabilitySet to None
// and sets all additionalEnabledCapabilities BUT the ones supplied in disabledCapabilities.
// This effectively disables that capability on the hosted cluster.
//
// When this is not supplied, the cluster will use the DefaultCapabilitySet defined for the respective
// OpenShift version.
//
// Once set, this field cannot be changed.
//
// +listType=atomic
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="disabledCapabilities is immutable"
// +optional
DisabledCapabilities []OptionalCapability `json:"disabledCapabilities,omitempty"`
}

// HostedClusterSpec is the desired behavior of a HostedCluster.

// +kubebuilder:validation:XValidation:rule=`self.platform.type != "IBMCloud" ? self.services == oldSelf.services : true`, message="Services is immutable. Changes might result in unpredictable and disruptive behavior."
Expand Down Expand Up @@ -633,6 +657,12 @@ type HostedClusterSpec struct {
// +kubebuilder:validation:MaxProperties=20
// +optional
Labels map[string]string `json:"labels,omitempty"`

// capabilities allows for disabling optional components at cluster install time.
// This field is optional and once set cannot be changed.
// +optional
// +openshift:enable:FeatureGate=DisableClusterCapabilities
Capabilities *Capabilities `json:"capabilities,omitempty"`
}

// OLMCatalogPlacement is an enum specifying the placement of OLM catalog components.
Expand Down Expand Up @@ -1127,7 +1157,7 @@ type KarpenterConfig struct {
}

type KarpenterAWSConfig struct {
//arn specifies the ARN of the Karpenter provisioner.
// arn specifies the ARN of the Karpenter provisioner.
// +required
RoleARN string `json:"roleARN"`
}
Expand Down Expand Up @@ -1237,9 +1267,7 @@ const (
PersistentVolumeEtcdStorage ManagedEtcdStorageType = "PersistentVolume"
)

var (
DefaultPersistentVolumeEtcdStorageSize resource.Quantity = resource.MustParse("8Gi")
)
var DefaultPersistentVolumeEtcdStorageSize resource.Quantity = resource.MustParse("8Gi")

// ManagedEtcdStorageSpec describes the storage configuration for etcd data.
type ManagedEtcdStorageSpec struct {
Expand Down
30 changes: 30 additions & 0 deletions api/hypershift/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ hostedclusters.hypershift.openshift.io:
FeatureGates:
- AROHCPManagedIdentities
- AutoNodeKarpenter
- DisableClusterCapabilities
- DynamicResourceAllocation
- ExternalOIDC
- ImageStreamImportMode
Expand Down Expand Up @@ -151,6 +152,7 @@ hostedcontrolplanes.hypershift.openshift.io:
FeatureGates:
- AROHCPManagedIdentities
- AutoNodeKarpenter
- DisableClusterCapabilities
- DynamicResourceAllocation
- ExternalOIDC
- ImageStreamImportMode
Expand Down
Loading