Skip to content

Commit e936914

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 a0fb5f4 commit e936914

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

config/v1/types_cluster_version.go

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ 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+
// +kubebuilder:validation:MaxItems=1000
208+
// +patchMergeKey=name
209+
// +patchStrategy=merge
210+
// +listType=map
211+
// +listMapKey=name
212+
// +optional
213+
ConditionalUpdateRisks []ConditionalUpdateRisk `json:"conditionalUpdateRisks,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
202214
}
203215

204216
// UpdateState is a constant representing whether an update was successfully
@@ -255,10 +267,11 @@ type UpdateHistory struct {
255267
Verified bool `json:"verified"`
256268

257269
// 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
270+
// For example, it may mention an Upgradeable=False or missing signature
271+
// that was overridden via desiredUpdate.force, or an update that was
260272
// initiated despite not being in the availableUpdates set of recommended
261-
// update targets.
273+
// update targets, or in the conditionUpdates set and all associated risks
274+
// are specified in "spec.desiredUpdate.accept".
262275
// +optional
263276
AcceptedRisks string `json:"acceptedRisks,omitempty"`
264277
}
@@ -725,6 +738,13 @@ type Update struct {
725738
//
726739
// +optional
727740
Force bool `json:"force"`
741+
742+
// accept allows an administrator to specify the names of ConditionalUpdateRisk
743+
// those are considered acceptable. A conditional update is accepted by Cluster-Version
744+
// operator only if all of its risks are acceptable.
745+
//
746+
// +optional
747+
Accept []string `json:"accept"`
728748
}
729749

730750
// Release represents an OpenShift release image and associated metadata.
@@ -780,11 +800,19 @@ type ConditionalUpdate struct {
780800
// +required
781801
Release Release `json:"release"`
782802

783-
// risks represents the range of issues associated with
803+
// riskNames are names of status.conditionalUpdateRisks
804+
// that are associated with the release in a ConditionalUpdate
805+
// +kubebuilder:validation:MinItems=1
806+
// +listType=set
807+
// +required
808+
RiskNames []string `json:"riskNames"`
809+
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
787814
// recommend the update.
815+
// DEPRECATED: the risks has been deprecated by riskNames and will be removed in a future release.
788816
// +kubebuilder:validation:MinItems=1
789817
// +patchMergeKey=name
790818
// +patchStrategy=merge

0 commit comments

Comments
 (0)