-
Notifications
You must be signed in to change notification settings - Fork 585
config/v1/types_cluster_version: Add capabilties properties #1106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,12 @@ type ClusterVersionSpec struct { | |
| // +optional | ||
| Channel string `json:"channel,omitempty"` | ||
|
|
||
| // capabilities configures the installation of optional, core | ||
| // cluster components. A null value here is identical to an | ||
| // empty object; see the child properties for default semantics. | ||
| // +optional | ||
| Capabilities *ClusterVersionCapabilitiesSpec `json:"capabilities,omitempty"` | ||
|
|
||
| // overrides is list of overides for components that are managed by | ||
| // cluster version operator. Marking a component unmanaged will prevent | ||
| // the operator from creating or updating the object. | ||
|
|
@@ -113,6 +119,9 @@ type ClusterVersionStatus struct { | |
| // +required | ||
| VersionHash string `json:"versionHash"` | ||
|
|
||
| // capabilities describes the state of optional, core cluster components. | ||
| Capabilities ClusterVersionCapabilitiesStatus `json:"capabilities"` | ||
|
|
||
| // conditions provides information about the cluster version. The condition | ||
| // "Available" is set to true if the desiredUpdate has been reached. The | ||
| // condition "Progressing" is set to true if an update is being applied. | ||
|
|
@@ -215,6 +224,86 @@ type UpdateHistory struct { | |
| // ClusterID is string RFC4122 uuid. | ||
| type ClusterID string | ||
|
|
||
| // ClusterVersionCapability enumerates optional, core cluster components. | ||
| // +kubebuilder:validation:Enum=openshift-samples | ||
| type ClusterVersionCapability string | ||
|
|
||
| const ( | ||
| // ClusterVersionCapabilityOpenShiftSamples manages the sample | ||
| // image streams and templates stored in the openshift | ||
| // namespace, and any registry credentials, stored as a secret, | ||
| // needed for the image streams to import the images they | ||
| // reference. | ||
| ClusterVersionCapabilityOpenShiftSamples ClusterVersionCapability = "openshift-samples" | ||
deads2k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
|
|
||
| // ClusterVersionCapabilitySet defines sets of cluster version capabilities. | ||
| // +kubebuilder:validation:Enum=None;v4.11;vCurrent | ||
| type ClusterVersionCapabilitySet string | ||
|
|
||
| const ( | ||
| // ClusterVersionCapabilitySetNone is an empty set enabling | ||
| // no optional capabilities. | ||
| ClusterVersionCapabilitySetNone ClusterVersionCapabilitySet = "None" | ||
|
|
||
| // ClusterVersionCapabilitySet4_11 is the recommended set of | ||
| // optional capabilities to enable for the 4.11 version of | ||
| // OpenShift. This list will remain the same no matter which | ||
| // version of OpenShift is installed. | ||
| ClusterVersionCapabilitySet4_11 ClusterVersionCapabilitySet = "v4.11" | ||
|
|
||
| // ClusterVersionCapabilitySetCurrent is the recommended set | ||
| // of optional capabilities to enable for the cluster's | ||
| // current version of OpenShift. | ||
| ClusterVersionCapabilitySetCurrent ClusterVersionCapabilitySet = "vCurrent" | ||
| ) | ||
|
|
||
| // ClusterVersionCapabilitySets defines sets of cluster version capabilities. | ||
| var ClusterVersionCapabilitySets = map[ClusterVersionCapabilitySet][]ClusterVersionCapability{ | ||
| ClusterVersionCapabilitySetNone: {}, | ||
| ClusterVersionCapabilitySet4_11: { | ||
| ClusterVersionCapabilityOpenShiftSamples, | ||
| }, | ||
| ClusterVersionCapabilitySetCurrent: { | ||
| ClusterVersionCapabilityOpenShiftSamples, | ||
| }, | ||
| } | ||
|
|
||
| // ClusterVersionCapabilitiesSpec selects the managed set of | ||
| // optional, core cluster components. | ||
| // +k8s:deepcopy-gen=true | ||
| type ClusterVersionCapabilitiesSpec struct { | ||
| // baselineCapabilitySet selects an initial set of | ||
| // optional capabilities to enable, which can be extended via | ||
| // additionalEnabledCapabilities. If unset, the cluster will | ||
| // choose a default, and the default may change over time. | ||
| // The current default is vCurrent. | ||
| // +optional | ||
| BaselineCapabilitySet ClusterVersionCapabilitySet `json:"baselineCapabilitySet,omitempty"` | ||
deads2k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // additionalEnabledCapabilities extends the set of managed | ||
| // capabilities beyond the baseline defined in | ||
| // baselineCapabilitySet. The default is an empty set. | ||
| // +listType=atomic | ||
| // +optional | ||
| AdditionalEnabledCapabilities []ClusterVersionCapability `json:"additionalEnabledCapabilities,omitempty"` | ||
| } | ||
|
|
||
| // ClusterVersionCapabilitiesStatus describes the state of optional, | ||
| // core cluster components. | ||
| // +k8s:deepcopy-gen=true | ||
| type ClusterVersionCapabilitiesStatus struct { | ||
bparees marked this conversation as resolved.
Show resolved
Hide resolved
wking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // enabledCapabilities lists all the capabilities that are currently managed. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be clear, this will include "implicilty enabled" capabilities, it's not just an enumeration of what is contained in the baselineCapabilitySet plus what is in additionalEnabledCapabilities, right? where an implicitly enabled capability would be a situation like:
|
||
| // +listType=atomic | ||
| // +optional | ||
| EnabledCapabilities []ClusterVersionCapability `json:"enabledCapabilities,omitempty"` | ||
|
|
||
| // knownCapabilities lists all the capabilities known to the current cluster. | ||
| // +listType=atomic | ||
| // +optional | ||
| KnownCapabilities []ClusterVersionCapability `json:"knownCapabilities,omitempty"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how is this set defined/managed/populated?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the semantics are basically "here are all the enum values from the CRD". I'm 🤷 on the mechanics. Is there a way for CRDs to hard-code property values? If not, I expect the CVO can stuff in the I don't think we can ever drop a named cap, because |
||
| } | ||
|
|
||
| // ComponentOverride allows overriding cluster version operator's behavior | ||
| // for a component. | ||
| // +k8s:deepcopy-gen=true | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.