Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions pkg/cvo/internal/operatorstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"sort"
"strings"
"time"
"unicode"

Expand Down Expand Up @@ -137,23 +136,7 @@ func waitForOperatorStatusToBeDone(ctx context.Context, interval time.Duration,
}
sort.Strings(keys)

var reports []string
for _, op := range keys {
// we do not need to report `operator` version.
if op == "operator" {
continue
}
ver := undone[op]
if len(ver) == 1 {
reports = append(reports, fmt.Sprintf("missing version information for %s", op))
continue
}
reports = append(reports, fmt.Sprintf("upgrading %s from %s to %s", op, ver[1], ver[0]))
}
message := fmt.Sprintf("Cluster operator %s is still updating", actual.Name)
if len(reports) > 0 {
message = fmt.Sprintf("Cluster operator %s is still updating: %s", actual.Name, strings.Join(reports, ", "))
}
lastErr = &payload.UpdateError{
Nested: errors.New(lowerFirst(message)),
Reason: "ClusterOperatorNotAvailable",
Expand All @@ -176,11 +159,6 @@ func waitForOperatorStatusToBeDone(ctx context.Context, interval time.Duration,
available = true
case condition.Type == configv1.OperatorProgressing && condition.Status == configv1.ConditionFalse:
progressing = false
case condition.Type == configv1.ClusterStatusConditionType("Failing"):
if condition.Status == configv1.ConditionFalse {
failing = false
}
failingCondition = condition
case condition.Type == configv1.OperatorDegraded:
if condition.Status == configv1.ConditionFalse {
degradedValue = false
Expand Down
24 changes: 12 additions & 12 deletions pkg/cvo/internal/operatorstatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ func Test_waitForOperatorStatusToBeDone(t *testing.T) {
},
},
expErr: &payload.UpdateError{
Nested: fmt.Errorf("cluster operator test-co is still updating: missing version information for operand-1"),
Nested: fmt.Errorf("cluster operator test-co is still updating"),
Reason: "ClusterOperatorNotAvailable",
Message: "Cluster operator test-co is still updating: missing version information for operand-1",
Message: "Cluster operator test-co is still updating",
Name: "test-co",
},
}, {
Expand All @@ -109,9 +109,9 @@ func Test_waitForOperatorStatusToBeDone(t *testing.T) {
},
},
expErr: &payload.UpdateError{
Nested: fmt.Errorf("cluster operator test-co is still updating: missing version information for operand-1"),
Nested: fmt.Errorf("cluster operator test-co is still updating"),
Reason: "ClusterOperatorNotAvailable",
Message: "Cluster operator test-co is still updating: missing version information for operand-1",
Message: "Cluster operator test-co is still updating",
Name: "test-co",
},
}, {
Expand All @@ -137,9 +137,9 @@ func Test_waitForOperatorStatusToBeDone(t *testing.T) {
},
},
expErr: &payload.UpdateError{
Nested: fmt.Errorf("cluster operator test-co is still updating: upgrading operand-1 from v0 to v1"),
Nested: fmt.Errorf("cluster operator test-co is still updating"),
Reason: "ClusterOperatorNotAvailable",
Message: "Cluster operator test-co is still updating: upgrading operand-1 from v0 to v1",
Message: "Cluster operator test-co is still updating",
Name: "test-co",
},
}, {
Expand All @@ -165,9 +165,9 @@ func Test_waitForOperatorStatusToBeDone(t *testing.T) {
},
},
expErr: &payload.UpdateError{
Nested: fmt.Errorf("cluster operator test-co is still updating: upgrading operand-1 from v0 to v1"),
Nested: fmt.Errorf("cluster operator test-co is still updating"),
Reason: "ClusterOperatorNotAvailable",
Message: "Cluster operator test-co is still updating: upgrading operand-1 from v0 to v1",
Message: "Cluster operator test-co is still updating",
Name: "test-co",
},
}, {
Expand Down Expand Up @@ -197,9 +197,9 @@ func Test_waitForOperatorStatusToBeDone(t *testing.T) {
},
},
expErr: &payload.UpdateError{
Nested: fmt.Errorf("cluster operator test-co is still updating: upgrading operand-1 from v0 to v1, upgrading operand-2 from v0 to v1"),
Nested: fmt.Errorf("cluster operator test-co is still updating"),
Reason: "ClusterOperatorNotAvailable",
Message: "Cluster operator test-co is still updating: upgrading operand-1 from v0 to v1, upgrading operand-2 from v0 to v1",
Message: "Cluster operator test-co is still updating",
Name: "test-co",
},
}, {
Expand Down Expand Up @@ -229,9 +229,9 @@ func Test_waitForOperatorStatusToBeDone(t *testing.T) {
},
},
expErr: &payload.UpdateError{
Nested: fmt.Errorf("cluster operator test-co is still updating: upgrading operand-2 from v0 to v1"),
Nested: fmt.Errorf("cluster operator test-co is still updating"),
Reason: "ClusterOperatorNotAvailable",
Message: "Cluster operator test-co is still updating: upgrading operand-2 from v0 to v1",
Message: "Cluster operator test-co is still updating",
Name: "test-co",
},
}, {
Expand Down