Skip to content

Commit fc12988

Browse files
Merge pull request #1348 from hongkailiu/accept-risks-diff
OTA-1546: Evaluate conditional updates if accept risks change
2 parents 602f35f + 9c99dee commit fc12988

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

pkg/cvo/availableupdates.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ func (optr *Operator) syncAvailableUpdates(ctx context.Context, config *configv1
9999
break
100100
}
101101
}
102+
if !acceptRisks.Equal(optrAvailableUpdates.AcceptRisks) {
103+
needsConditionalUpdateEval = true
104+
}
102105
if !needsConditionalUpdateEval {
103106
klog.V(2).Infof("Available updates were recently retrieved, with less than %s elapsed since %s, will try later.", optr.minimumUpdateCheckInterval, optrAvailableUpdates.LastAttempt.Format(time.RFC3339))
104107
return nil
@@ -142,8 +145,6 @@ func (optr *Operator) syncAvailableUpdates(ctx context.Context, config *configv1
142145
optrAvailableUpdates.UpdateService = updateService
143146
optrAvailableUpdates.Channel = channel
144147
optrAvailableUpdates.Architecture = desiredArch
145-
optrAvailableUpdates.ShouldReconcileAcceptRisks = optr.shouldReconcileAcceptRisks
146-
optrAvailableUpdates.AcceptRisks = acceptRisks
147148
optrAvailableUpdates.ConditionRegistry = optr.conditionRegistry
148149
optrAvailableUpdates.Condition = condition
149150

@@ -159,6 +160,8 @@ func (optr *Operator) syncAvailableUpdates(ctx context.Context, config *configv1
159160
}
160161
}
161162

163+
optrAvailableUpdates.AcceptRisks = acceptRisks
164+
optrAvailableUpdates.ShouldReconcileAcceptRisks = optr.shouldReconcileAcceptRisks
162165
optrAvailableUpdates.evaluateConditionalUpdates(ctx)
163166

164167
queueKey := optr.queueKey()

0 commit comments

Comments
 (0)