Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ func (w *monitor) noFailingUnknownCondition(intervals monitorapi.Intervals) []*j

for _, coName := range platformidentification.KnownOperators.List() {
bzComponent := platformidentification.GetBugzillaComponentForOperator(coName)
if bzComponent == "Unknown" {
bzComponent = coName
}
name := fmt.Sprintf("[bz-%v] clusteroperator/%v must complete version change within limited time", bzComponent, coName)
m := 30
if coName == "machine-config" {
Expand Down Expand Up @@ -208,6 +205,9 @@ func parseClusterOperatorNames(message string) (sets.Set[string], error) {
ret.Insert(strings.TrimSpace(coName))
}
}
if diff := sets.List(ret.Difference(sets.New[string](platformidentification.KnownOperators.List()...))); len(diff) > 0 {
return nil, fmt.Errorf("found unknown operator names %q from %q", strings.Join(diff, ", "), message)
}
if len(ret) == 0 {
return nil, fmt.Errorf("failed to parse cluster operator names from %q", message)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func Test_parseClusterOperatorNames(t *testing.T) {
{
name: "one CO timeout",
reason: "SlowClusterOperator",
message: "waiting on co-timeout over 30 minutes which is longer than expected",
expected: sets.New[string]("co-timeout"),
message: "waiting on network over 30 minutes which is longer than expected",
expected: sets.New[string]("network"),
},
{
name: "mco timeout",
Expand All @@ -53,20 +53,26 @@ func Test_parseClusterOperatorNames(t *testing.T) {
{
name: "two COs timeout",
reason: "SlowClusterOperator",
message: "waiting on co-timeout, co-bar-timeout over 30 minutes which is longer than expected",
expected: sets.New[string]("co-timeout", "co-bar-timeout"),
message: "waiting on console, network over 30 minutes which is longer than expected",
expected: sets.New[string]("console", "network"),
},
{
name: "one CO and mco timeout",
reason: "SlowClusterOperator",
message: "waiting on co-timeout over 30 minutes and machine-config over 90 minutes which is longer than expected",
expected: sets.New[string]("machine-config", "co-timeout"),
message: "waiting on network over 30 minutes and machine-config over 90 minutes which is longer than expected",
expected: sets.New[string]("machine-config", "network"),
},
{
name: "three COs timeout",
reason: "SlowClusterOperator",
message: "waiting on co-timeout, co-bar-timeout over 30 minutes and machine-config over 90 minutes which is longer than expected",
expected: sets.New[string]("machine-config", "co-timeout", "co-bar-timeout"),
message: "waiting on console, network over 30 minutes and machine-config over 90 minutes which is longer than expected",
expected: sets.New[string]("machine-config", "console", "network"),
},
{
name: "unknown operators",
reason: "SlowClusterOperator",
message: "waiting on unknown, bar, network over 30 minutes and machine-config over 90 minutes which is longer than expected",
expectedErr: fmt.Errorf(`found unknown operator names "bar, unknown" from "changed to Some=Unknown: SlowClusterOperator: waiting on unknown, bar, network over 30 minutes and machine-config over 90 minutes which is longer than expected"`),
},
}

Expand Down