Skip to content

Commit 47f73af

Browse files
committed
[OTA-1545] Extend ClusterVersion for accepted risks
- Add a new field 'clusterversion.spec.desiredUpdate.accept': It contains the names of conditional update risks that are considered acceptable. - Move `clusterversion.status.conditionalUpdates.risks` two levels up as `clusterversion.status.conditionalUpdateRisks`. It contains all the risks for `clusterversion.status.conditionalUpdates`. - Add a new field 'clusterversion.status.conditionalUpdates.riskNames': It contains the names of risk for the conditional update. It deprecates `clusterversion.status.conditionalUpdates.risks`.
1 parent eaa19bc commit 47f73af

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

config/v1/types_cluster_version.go

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@ type ClusterVersionStatus struct {
199199
// +listType=atomic
200200
// +optional
201201
ConditionalUpdates []ConditionalUpdate `json:"conditionalUpdates,omitempty"`
202+
203+
// conditionalUpdateRisks represent issues for ConditionalUpdates.
204+
// The cluster-version operator will evaluate all risks associated to a conditional
205+
// update when it is the desired update and only accept it if all its associated
206+
// risks are in "spec.desiredUpdate.accept".
207+
// +listType=atomic
208+
// +optional
209+
ConditionalUpdateRisks []ConditionalUpdateRisk `json:"conditionalUpdateRisks,omitempty"`
202210
}
203211

204212
// UpdateState is a constant representing whether an update was successfully
@@ -255,10 +263,11 @@ type UpdateHistory struct {
255263
Verified bool `json:"verified"`
256264

257265
// acceptedRisks records risks which were accepted to initiate the update.
258-
// For example, it may menition an Upgradeable=False or missing signature
259-
// that was overriden via desiredUpdate.force, or an update that was
266+
// For example, it may mention an Upgradeable=False or missing signature
267+
// that was overridden via desiredUpdate.force, or an update that was
260268
// initiated despite not being in the availableUpdates set of recommended
261-
// update targets.
269+
// update targets, or in the conditionUpdates set and all associated risks
270+
// are specified in "spec.desiredUpdate.accept".
262271
// +optional
263272
AcceptedRisks string `json:"acceptedRisks,omitempty"`
264273
}
@@ -725,6 +734,13 @@ type Update struct {
725734
//
726735
// +optional
727736
Force bool `json:"force"`
737+
738+
// accept allows an administrator to specify the names of ConditionalUpdateRisk
739+
// those are considered acceptable. A conditional update is accepted by Cluster-Version
740+
// operator only if all of its risks are acceptable.
741+
//
742+
// +optional
743+
Accept []string `json:"accept"`
728744
}
729745

730746
// Release represents an OpenShift release image and associated metadata.
@@ -780,11 +796,19 @@ type ConditionalUpdate struct {
780796
// +required
781797
Release Release `json:"release"`
782798

783-
// risks represents the range of issues associated with
799+
// riskNames are names of status.conditionalUpdateRisks
800+
// that are associated with the release in a ConditionalUpdate
801+
// +kubebuilder:validation:MinItems=1
802+
// +listType=set
803+
// +required
804+
RiskNames []string `json:"riskNames"`
805+
806+
// risks represent the range of issues associated with
784807
// updating to the target release. The cluster-version
785808
// operator will evaluate all entries, and only recommend the
786809
// update if there is at least one entry and all entries
787810
// recommend the update.
811+
// DEPRECATED: the risks has been deprecated by riskNames and will be removed in a future release.
788812
// +kubebuilder:validation:MinItems=1
789813
// +patchMergeKey=name
790814
// +patchStrategy=merge

0 commit comments

Comments
 (0)