@@ -199,6 +199,18 @@ type ClusterVersionStatus struct {
199
199
// +listType=atomic
200
200
// +optional
201
201
ConditionalUpdates []ConditionalUpdate `json:"conditionalUpdates,omitempty"`
202
+
203
+ // conditionalUpdateRisks represents 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"`
202
214
}
203
215
204
216
// UpdateState is a constant representing whether an update was successfully
@@ -255,10 +267,11 @@ type UpdateHistory struct {
255
267
Verified bool `json:"verified"`
256
268
257
269
// 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
260
272
// 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".
262
275
// +optional
263
276
AcceptedRisks string `json:"acceptedRisks,omitempty"`
264
277
}
@@ -725,6 +738,15 @@ type Update struct {
725
738
//
726
739
// +optional
727
740
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
+ // +kubebuilder:validation:items:MaxLength=256
747
+ // +kubebuilder:validation:MaxItems=1000
748
+ // +optional
749
+ Accept []string `json:"accept"`
728
750
}
729
751
730
752
// Release represents an OpenShift release image and associated metadata.
@@ -780,11 +802,25 @@ type ConditionalUpdate struct {
780
802
// +required
781
803
Release Release `json:"release"`
782
804
805
+ // riskNames represents names of status.conditionalUpdateRisks
806
+ // that are associated with the release in a ConditionalUpdate.
807
+ // The cluster-version operator will evaluate these risks and only
808
+ // accept the update if there is at least one risk and for every risk
809
+ // it is either not applied to the cluster or considered acceptable
810
+ // by the cluster administrator.
811
+ // +kubebuilder:validation:items:MaxLength=256
812
+ // +kubebuilder:validation:MaxItems=100
813
+ // +kubebuilder:validation:MinItems=1
814
+ // +listType=set
815
+ // +required
816
+ RiskNames []string `json:"riskNames"`
817
+
783
818
// risks represents the range of issues associated with
784
819
// updating to the target release. The cluster-version
785
820
// operator will evaluate all entries, and only recommend the
786
821
// update if there is at least one entry and all entries
787
822
// recommend the update.
823
+ // DEPRECATED: the risks has been deprecated by riskNames and will be removed in a future release.
788
824
// +kubebuilder:validation:MinItems=1
789
825
// +patchMergeKey=name
790
826
// +patchStrategy=merge
@@ -806,6 +842,15 @@ type ConditionalUpdate struct {
806
842
// for not recommending a conditional update.
807
843
// +k8s:deepcopy-gen=true
808
844
type ConditionalUpdateRisk struct {
845
+ // conditions represents the observations of the conditional update
846
+ // risk's current status. Known types are:
847
+ // * Apply, for whether the risk is applied to the current cluster.
848
+ // +kubebuilder:validation:MaxItems=16
849
+ // +listType=map
850
+ // +listMapKey=type
851
+ // +optional
852
+ Conditions []metav1.Condition `json:"conditions,omitempty"`
853
+
809
854
// url contains information about this risk.
810
855
// +kubebuilder:validation:Format=uri
811
856
// +kubebuilder:validation:MinLength=1
0 commit comments