Skip to content

Commit

Permalink
Improve condition's reason and message
Browse files Browse the repository at this point in the history
  • Loading branch information
hongkailiu committed Nov 5, 2024
1 parent 0366e77 commit c1f693a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/cvo/upgradeable.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ func (check *upgradeInProgressUpgradeable) Check() *configv1.ClusterOperatorStat

if progressingCondition := resourcemerge.FindOperatorStatusCondition(cv.Status.Conditions, configv1.OperatorProgressing); progressingCondition != nil &&
progressingCondition.Status == configv1.ConditionTrue {
cond.Reason = progressingCondition.Reason
cond.Message = progressingCondition.Message
cond.Reason = "UpdateInProgress"
cond.Message = fmt.Sprintf("An update is already in progress and the details are in the %s condition", configv1.OperatorProgressing)
return cond
}
return nil
Expand Down
8 changes: 4 additions & 4 deletions pkg/cvo/upgradeable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ func TestUpgradeInProgressUpgradeable(t *testing.T) {
{
Type: configv1.OperatorProgressing,
Status: configv1.ConditionTrue,
Reason: "a",
Message: "b",
Reason: "UpdateInProgress",
Message: "An update is already in progress and the details are in the Progressing condition",
},
},
},
},
expected: &configv1.ClusterOperatorStatusCondition{
Type: "UpgradeableUpgradeInProgress",
Status: configv1.ConditionTrue,
Reason: "a",
Message: "b",
Reason: "UpdateInProgress",
Message: "An update is already in progress and the details are in the Progressing condition",
},
},
{
Expand Down

0 comments on commit c1f693a

Please sign in to comment.