-
Notifications
You must be signed in to change notification settings - Fork 552
[OTA-1545] Extend ClusterVersion for accepted risks #2360
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -199,6 +199,20 @@ type ClusterVersionStatus struct { | |||||
// +listType=atomic | ||||||
// +optional | ||||||
ConditionalUpdates []ConditionalUpdate `json:"conditionalUpdates,omitempty"` | ||||||
|
||||||
// conditionalUpdateRisks contains the list of risks associated with conditionalUpdates. | ||||||
// When performing a conditional update, all its associated risks will be compared with the set of accepted risks in the spec.desiredUpdate.accept field. | ||||||
// If all risks for a conditional update are included in the spec.desiredUpdate.accept set, the conditional update will proceed, otherwise it is blocked. | ||||||
// The risk's names in the list must be unique. | ||||||
// conditionalUpdateRisks must not contain more than 500 entries. | ||||||
// +openshift:enable:FeatureGate=ClusterUpdateAcceptedRisks | ||||||
// +kubebuilder:validation:MaxItems=500 | ||||||
// +patchMergeKey=name | ||||||
// +patchStrategy=merge | ||||||
Comment on lines
+210
to
+211
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. Not valid for CRDs, please remove |
||||||
// +listType=map | ||||||
// +listMapKey=name | ||||||
// +optional | ||||||
ConditionalUpdateRisks []ConditionalUpdateRisk `json:"conditionalUpdateRisks,omitempty" patchStrategy:"merge" patchMergeKey:"name"` | ||||||
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.
Suggested change
|
||||||
} | ||||||
|
||||||
// UpdateState is a constant representing whether an update was successfully | ||||||
|
@@ -255,10 +269,11 @@ type UpdateHistory struct { | |||||
Verified bool `json:"verified"` | ||||||
|
||||||
// acceptedRisks records risks which were accepted to initiate the update. | ||||||
// For example, it may menition an Upgradeable=False or missing signature | ||||||
// that was overriden via desiredUpdate.force, or an update that was | ||||||
// For example, it may mention an Upgradeable=False or missing signature | ||||||
// that was overridden via desiredUpdate.force, or an update that was | ||||||
// initiated despite not being in the availableUpdates set of recommended | ||||||
// update targets. | ||||||
// update targets, or in the conditionUpdates set and all associated risks | ||||||
// are specified in desiredUpdate.accept. | ||||||
Comment on lines
+275
to
+276
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. Similarly, this change also appears in the default CRD. You may want to include that this part of the description only applies when the particular feature gate is enabled or drop it from the description until you GA the feature. |
||||||
// +optional | ||||||
AcceptedRisks string `json:"acceptedRisks,omitempty"` | ||||||
} | ||||||
|
@@ -725,6 +740,17 @@ type Update struct { | |||||
// | ||||||
// +optional | ||||||
Force bool `json:"force"` | ||||||
|
||||||
// accept is an optional set of names of conditional update risks that are considered acceptable. | ||||||
// A conditional update is performed only if all of its risks are acceptable. | ||||||
// Entries must be unique and must not exceed 256 characters. | ||||||
// accept must not contain more than 1000 entries. | ||||||
// +openshift:enable:FeatureGate=ClusterUpdateAcceptedRisks | ||||||
// +kubebuilder:validation:items:MaxLength=256 | ||||||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
// +kubebuilder:validation:MaxItems=1000 | ||||||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
// +listType=set | ||||||
// +optional | ||||||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Accept []string `json:"accept"` | ||||||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
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. Out of interest, why not |
||||||
} | ||||||
|
||||||
// Release represents an OpenShift release image and associated metadata. | ||||||
|
@@ -780,11 +806,24 @@ type ConditionalUpdate struct { | |||||
// +required | ||||||
Release Release `json:"release"` | ||||||
|
||||||
// riskNames represents the set of the names of conditionalUpdateRisks in the status that are exposed to the release in this conditional update. | ||||||
// A condition update is accepted only if each of its risk is either not applied to the cluster or considered acceptable by the cluster administrator. | ||||||
// Entries must be unique and must not exceed 256 characters. | ||||||
// riskNames must not contain more than 500 entries. | ||||||
// +openshift:enable:FeatureGate=ClusterUpdateAcceptedRisks | ||||||
// +kubebuilder:validation:MinItems=1 | ||||||
// +kubebuilder:validation:items:MaxLength=256 | ||||||
// +kubebuilder:validation:MaxItems=500 | ||||||
// +listType=set | ||||||
// +optional | ||||||
RiskNames []string `json:"riskNames,omitempty"` | ||||||
Comment on lines
+809
to
+819
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. So this is an odd direction for a change. Why are we moving from a list of structured objects to a list of strings? Normally, I see this the other way around?
Comment on lines
+809
to
+819
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. What does it mean to set both |
||||||
|
||||||
// risks represents the range of issues associated with | ||||||
// updating to the target release. The cluster-version | ||||||
// operator will evaluate all entries, and only recommend the | ||||||
// update if there is at least one entry and all entries | ||||||
// recommend the update. | ||||||
// Deprecated: the risks has been deprecated by riskNames. | ||||||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
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. Something worth noting - this shows up on the non-featuregated version of the API. I'm not sure there is much of a workaround for this unless you wait to add this deprecation text until you actually go to promote the feature-gate that deprecates this to GA. I would probably recommend removing this for now. 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.
Suggested change
|
||||||
// +kubebuilder:validation:MinItems=1 | ||||||
// +patchMergeKey=name | ||||||
// +patchStrategy=merge | ||||||
|
@@ -806,6 +845,19 @@ type ConditionalUpdate struct { | |||||
// for not recommending a conditional update. | ||||||
// +k8s:deepcopy-gen=true | ||||||
type ConditionalUpdateRisk struct { | ||||||
// conditions represents the observations of the conditional update | ||||||
// risk's current status. Known types are: | ||||||
// * Applies, for whether the risk applies to the current cluster. | ||||||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
// The condition's types in the list must be unique. | ||||||
// conditions must not contain more than one entry. | ||||||
// +openshift:enable:FeatureGate=ClusterUpdateAcceptedRisks | ||||||
// +kubebuilder:validation:items:XValidation:rule="has(self.type) && self.type == 'Applies'",message="type must be 'Applies'" | ||||||
// +kubebuilder:validation:MaxItems=1 | ||||||
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. MinItems too please |
||||||
// +listType=map | ||||||
// +listMapKey=type | ||||||
// +optional | ||||||
Conditions []metav1.Condition `json:"conditions,omitempty"` | ||||||
|
||||||
// url contains information about this risk. | ||||||
// +kubebuilder:validation:Format=uri | ||||||
// +kubebuilder:validation:MinLength=1 | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double plural reads oddly to me, WDYT?