diff --git a/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest.go b/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest.go index 3e42583e2b04..a880e7c2d176 100644 --- a/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest.go +++ b/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest.go @@ -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" { @@ -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) } diff --git a/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest_test.go b/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest_test.go index 7605a3cf86ff..c50d5ace6042 100644 --- a/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest_test.go +++ b/pkg/monitortests/clusterversionoperator/clusterversionchecker/monitortest_test.go @@ -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", @@ -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"`), }, }