Skip to content

Commit 0eed585

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 017e9dd commit 0eed585

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

config/v1/types_cluster_version.go

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,17 @@ 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+
// +patchMergeKey=name
208+
// +patchStrategy=merge
209+
// +listType=map
210+
// +listMapKey=name
211+
// +optional
212+
ConditionalUpdateRisks []ConditionalUpdateRisk `json:"conditionalUpdateRisks" patchStrategy:"merge" patchMergeKey:"name"`
202213
}
203214

204215
// UpdateState is a constant representing whether an update was successfully
@@ -255,10 +266,11 @@ type UpdateHistory struct {
255266
Verified bool `json:"verified"`
256267

257268
// 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
269+
// For example, it may mention an Upgradeable=False or missing signature
270+
// that was overridden via desiredUpdate.force, or an update that was
260271
// initiated despite not being in the availableUpdates set of recommended
261-
// update targets.
272+
// update targets, or in the conditionUpdates set and all associated risks
273+
// are specified in "spec.desiredUpdate.accept".
262274
// +optional
263275
AcceptedRisks string `json:"acceptedRisks,omitempty"`
264276
}
@@ -725,6 +737,13 @@ type Update struct {
725737
//
726738
// +optional
727739
Force bool `json:"force"`
740+
741+
// accept allows an administrator to specify the names of ConditionalUpdateRisk
742+
// those are considered acceptable. A conditional update is accepted by Cluster-Version
743+
// operator only if all of its risks are acceptable.
744+
//
745+
// +optional
746+
Accept []string `json:"accept"`
728747
}
729748

730749
// Release represents an OpenShift release image and associated metadata.
@@ -780,7 +799,15 @@ type ConditionalUpdate struct {
780799
// +required
781800
Release Release `json:"release"`
782801

783-
// risks represents the range of issues associated with
802+
// riskNames are names of status.conditionalUpdateRisks
803+
// that are associated with the release in a ConditionalUpdate
804+
// +kubebuilder:validation:MinItems=1
805+
// +listType=set
806+
// +required
807+
RiskNames []string `json:"riskNames"`
808+
809+
// DEPRECATED: the risks has been deprecated by riskNames and will be removed in a future release.
810+
// risks represent the range of issues associated with
784811
// updating to the target release. The cluster-version
785812
// operator will evaluate all entries, and only recommend the
786813
// update if there is at least one entry and all entries

0 commit comments

Comments
 (0)