-
Notifications
You must be signed in to change notification settings - Fork 585
[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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
458 changes: 458 additions & 0 deletions
458
config/v1/tests/clusterversions.config.openshift.io/ClusterUpdateAcceptRisks.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,9 +199,23 @@ type ClusterVersionStatus struct { | |
| // availableUpdates. This list may be empty if no updates are | ||
| // recommended, if the update service is unavailable, or if an empty | ||
| // or invalid channel has been specified. | ||
| // +kubebuilder:validation:MaxItems=500 | ||
| // +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.acceptRisks field. | ||
| // If all risks for a conditional update are included in the spec.desiredUpdate.acceptRisks set, the conditional update can proceed, otherwise it is blocked. | ||
| // The risk names in the list must be unique. | ||
| // conditionalUpdateRisks must not contain more than 500 entries. | ||
| // +openshift:enable:FeatureGate=ClusterUpdateAcceptRisks | ||
| // +kubebuilder:validation:MaxItems=500 | ||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // +kubebuilder:validation:MinItems=1 | ||
| // +listType=map | ||
| // +listMapKey=name | ||
| // +optional | ||
| ConditionalUpdateRisks []ConditionalUpdateRisk `json:"conditionalUpdateRisks,omitempty"` | ||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| // UpdateState is a constant representing whether an update was successfully | ||
|
|
@@ -258,7 +272,7 @@ 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 | ||
| // 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. | ||
|
|
@@ -732,6 +746,30 @@ type Update struct { | |
| // | ||
| // +optional | ||
| Force bool `json:"force"` | ||
|
|
||
| // acceptRisks 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. | ||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // This list may contain entries that apply to current, previous or future updates. | ||
| // The entries therefore may not map directly to a risk in .status.conditionalUpdateRisks. | ||
| // acceptRisks must not contain more than 1000 entries. | ||
| // Entries in this list must be unique. | ||
| // +openshift:enable:FeatureGate=ClusterUpdateAcceptRisks | ||
| // +kubebuilder:validation:MaxItems=1000 | ||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // +kubebuilder:validation:MinItems=1 | ||
| // +listType=map | ||
| // +listMapKey=name | ||
| // +optional | ||
| AcceptRisks []AcceptRisk `json:"acceptRisks,omitempty"` | ||
| } | ||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // AcceptRisk represents a risk that is considered acceptable. | ||
| type AcceptRisk struct { | ||
| // name is the name of the acceptable risk. | ||
| // It must be a non-empty string and must not exceed 256 characters. | ||
| // +kubebuilder:validation:MinLength=1 | ||
| // +kubebuilder:validation:MaxLength=256 | ||
| // +required | ||
| Name string `json:"name,omitempty"` | ||
| } | ||
|
Comment on lines
+765
to
773
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. Critical: Remove The
🔎 Fix: Remove omitempty from the json tag // +required
- Name string `json:"name,omitempty"`
+ Name string `json:"name"`🤖 Prompt for AI Agents |
||
|
|
||
| // Release represents an OpenShift release image and associated metadata. | ||
|
|
@@ -787,12 +825,27 @@ type ConditionalUpdate struct { | |
| // +required | ||
| Release Release `json:"release"` | ||
|
|
||
| // riskNames represents the set of the names of conditionalUpdateRisks that are relevant to this update for some clusters. | ||
| // The Applies condition of each conditionalUpdateRisks entry declares if that risk applies to this cluster. | ||
| // A conditional update is accepted only if each of its risks either does not apply to the cluster or is considered acceptable by the cluster administrator. | ||
| // The latter means that the risk names are included in value of the spec.desiredUpdate.acceptRisks field. | ||
| // Entries must be unique and must not exceed 256 characters. | ||
| // riskNames must not contain more than 500 entries. | ||
| // +openshift:enable:FeatureGate=ClusterUpdateAcceptRisks | ||
| // +kubebuilder:validation:MinItems=1 | ||
| // +kubebuilder:validation:items:MaxLength=256 | ||
| // +kubebuilder:validation:MaxItems=500 | ||
| // +listType=set | ||
| // +optional | ||
| RiskNames []string `json:"riskNames,omitempty"` | ||
|
|
||
| // 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. | ||
| // +kubebuilder:validation:MinItems=1 | ||
| // +kubebuilder:validation:MaxItems=200 | ||
| // +patchMergeKey=name | ||
| // +patchStrategy=merge | ||
| // +listType=map | ||
|
|
@@ -813,6 +866,20 @@ 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=ClusterUpdateAcceptRisks | ||
| // +kubebuilder:validation:XValidation:rule="self.exists_one(x, x.type == 'Applies')",message="must contain a condition of type 'Applies'" | ||
hongkailiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // +kubebuilder:validation:MaxItems=8 | ||
| // +kubebuilder:validation:MinItems=1 | ||
| // +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 | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.