Skip to content

Commit 037e84d

Browse files
added mcp status reporting for ocl builds
Removed comment
1 parent f4b3f01 commit 037e84d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/controller/node/status.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,21 @@ func (ctrl *Controller) calculateStatus(fg featuregates.FeatureGate, mcs []*mcfg
277277
}
278278
}
279279

280+
if mosc != nil && !pool.Spec.Paused {
281+
// MOSC exists but MOSB doesn't exist yet -> change MCP to update
282+
if mosb == nil {
283+
updating := apihelpers.NewMachineConfigPoolCondition(mcfgv1.MachineConfigPoolUpdating, corev1.ConditionTrue, "", fmt.Sprintf("Pool is waiting for a new OS image build to start (mosc: %s)", mosc.Name))
284+
apihelpers.SetMachineConfigPoolCondition(&status, *updating)
285+
} else {
286+
// Some cases we have an old MOSB object that still exists, we still update MCP
287+
mosbState := ctrlcommon.NewMachineOSBuildState(mosb)
288+
if mosbState.IsBuilding() || mosbState.IsBuildPrepared() {
289+
updating := apihelpers.NewMachineConfigPoolCondition(mcfgv1.MachineConfigPoolUpdating, corev1.ConditionTrue, "", fmt.Sprintf("Pool is waiting for OS image build to complete (mosb: %s)", mosb.Name))
290+
apihelpers.SetMachineConfigPoolCondition(&status, *updating)
291+
}
292+
}
293+
}
294+
280295
var nodeDegraded bool
281296
var nodeDegradedMessage string
282297
for _, m := range degradedMachines {

0 commit comments

Comments
 (0)