Skip to content

Commit 2d3f2b9

Browse files
committed
Check CO's 1st line pattern
1 parent 578bc33 commit 2d3f2b9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/monitortests/cli/adm_upgrade/status/controlplane.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
var (
13-
operatorLinePattern = regexp.MustCompile(`^\S+\s+\S+\s+\S+\s+.*$`)
13+
operatorFirstLinePattern = regexp.MustCompile(`^\S+\s+\S+\s+\S+\s+.*$`)
1414
)
1515

1616
func (w *monitor) controlPlane() *junitapi.JUnitTestCase {
@@ -106,12 +106,12 @@ func (w *monitor) controlPlane() *junitapi.JUnitTestCase {
106106
}
107107
}
108108

109-
// TODO: `oc adm upgrade status` emits operators with linebreaks in messages in a crappy way which we will need to fix
110-
// for _, operator := range cp.Operators {
111-
// if !operatorLinePattern.MatchString(operator) {
112-
// fail(fmt.Sprintf("Bad line in operators: %s", operator))
113-
// }
114-
// }
109+
for _, operator := range cp.Operators {
110+
firstLine := strings.Split(operator, "\n")[0]
111+
if !operatorFirstLinePattern.MatchString(firstLine) {
112+
fail(fmt.Sprintf("Bad first line in operators: %s", operator))
113+
}
114+
}
115115

116116
for _, node := range cp.Nodes {
117117
if !nodeLinePattern.MatchString(node) {

0 commit comments

Comments
 (0)