Skip to content

Commit 7e4a336

Browse files
hongkailiuopenshift-cherrypick-robot
authored andcommitted
Move slowCOUpdatePrefix Reason instead of Message
1 parent 3c3b82b commit 7e4a336

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pkg/cvo/status.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,13 @@ func updateClusterVersionStatus(cvStatus *configv1.ClusterVersionStatus, status
322322
failingCondition.Message = failingMessage
323323
}
324324
if failure != nil &&
325-
skipFailure &&
326-
(progressReason == "ClusterOperatorUpdating" || progressReason == "ClusterOperatorsUpdating") &&
327-
strings.HasPrefix(progressMessage, slowCOUpdatePrefix) {
328-
progressMessage = strings.TrimPrefix(progressMessage, slowCOUpdatePrefix)
325+
strings.HasPrefix(progressReason, slowCOUpdatePrefix) {
329326
failingCondition.Status = configv1.ConditionUnknown
330327
failingCondition.Reason = "SlowClusterOperator"
331328
failingCondition.Message = progressMessage
332329
}
330+
progressReason = strings.TrimPrefix(progressReason, slowCOUpdatePrefix)
331+
333332
resourcemerge.SetOperatorStatusCondition(&cvStatus.Conditions, failingCondition)
334333

335334
// update progressing
@@ -583,13 +582,13 @@ func convertErrorToProgressing(now time.Time, statusFailure error) (reason strin
583582
}
584583
// returns true in those slow cases because it is still only a suspicion
585584
if len(exceeded) > 0 && !machineConfig {
586-
return uErr.Reason, fmt.Sprintf("%swaiting on %s over 30 minutes which is longer than expected", slowCOUpdatePrefix, strings.Join(exceeded, ", ")), true
585+
return slowCOUpdatePrefix + uErr.Reason, fmt.Sprintf("waiting on %s over 30 minutes which is longer than expected", strings.Join(exceeded, ", ")), true
587586
}
588587
if len(exceeded) > 0 && machineConfig {
589-
return uErr.Reason, fmt.Sprintf("%swaiting on %s over 30 minutes and machine-config over 90 minutes which is longer than expected", slowCOUpdatePrefix, strings.Join(exceeded, ", ")), true
588+
return slowCOUpdatePrefix + uErr.Reason, fmt.Sprintf("waiting on %s over 30 minutes and machine-config over 90 minutes which is longer than expected", strings.Join(exceeded, ", ")), true
590589
}
591590
if len(exceeded) == 0 && machineConfig {
592-
return uErr.Reason, fmt.Sprintf("%swaiting on machine-config over 90 minutes which is longer than expected", slowCOUpdatePrefix), true
591+
return slowCOUpdatePrefix + uErr.Reason, "waiting on machine-config over 90 minutes which is longer than expected", true
593592
}
594593
return uErr.Reason, fmt.Sprintf("waiting on %s", strings.Join(names, ", ")), true
595594
case payload.UpdateEffectFail:

0 commit comments

Comments
 (0)