@@ -88,7 +88,7 @@ func (w *monitor) updateLifecycle(wasUpdated wasUpdatedFn) *junitapi.JUnitTestCa
8888 wroteOnce = true
8989 failureOutputBuilder .WriteString (fmt .Sprintf ("\n ===== %s\n " , observed .when .Format (time .RFC3339 )))
9090 failureOutputBuilder .WriteString (observed .output .rawOutput )
91- failureOutputBuilder .WriteString (fmt .Sprintf ("=> %s\n " , message ))
91+ failureOutputBuilder .WriteString (fmt .Sprintf ("\n \n => %s\n " , message ))
9292 }
9393 }
9494
@@ -99,22 +99,32 @@ func (w *monitor) updateLifecycle(wasUpdated wasUpdatedFn) *junitapi.JUnitTestCa
9999 continue
100100 }
101101
102+ controlPlane := observed .output .controlPlane
103+
102104 o := notUpdating
103105 switch {
104- case observed . output . controlPlane .Updated :
106+ case controlPlane != nil && controlPlane .Updated :
105107 o = controlPlaneObservedUpdated
106- case observed . output . controlPlane .NodesUpdated :
108+ case controlPlane != nil && controlPlane .NodesUpdated :
107109 o = controlPlaneObservedNodesUpdated
108110 case observed .output .updating :
109111 o = controlPlaneObservedUpdating
110112 }
111113
112- if next , ok := stateTransitions [current ][o ]; ! ok {
114+ fromCurrent := stateTransitions [current ]
115+ if next , ok := fromCurrent [o ]; ! ok {
113116 fail (fmt .Sprintf ("Unexpected observation '%s' in state '%s'" , o , current ))
114117 } else {
115118 current = next
116119 }
117120 }
118121
122+ if failureOutputBuilder .Len () > 0 {
123+ health .FailureOutput = & junitapi.FailureOutput {
124+ Message : fmt .Sprintf ("observed unexpected update lifecycle transition in oc adm upgrade status" ),
125+ Output : failureOutputBuilder .String (),
126+ }
127+ }
128+
119129 return health
120130}
0 commit comments