Skip to content

Commit bb1965f

Browse files
committed
only report Progressing for active network rollouts
Keep pod-based Progressing tied to an actual CNO rollout instead of temporary unavailability during node reboot churn. Persist the rollout generation in status manager state so Progressing stays true until the rollout is both observed and fully available. For machine config status, stop treating generic MCP node convergence as a CNO rollout signal. Check whether the CNO machine config is still present in the pool's rendered source list so routine MCO updates do not flip network Progressing to true. Also persist install completion in the same annotation so a restarted CNO does not fall back into startup-only Progressing paths during a cluster upgrade. That prevents noncritical networking pods from briefly setting Progressing=true after the actual network rollout is already complete. Signed-off-by: Jamo Luhrsen <jluhrsen@gmail.com> Co-Authored-by: Claude Code and Codex
1 parent 2b7b23c commit bb1965f

3 files changed

Lines changed: 343 additions & 64 deletions

File tree

pkg/controller/statusmanager/machineconfig_status.go

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
configv1 "github.com/openshift/api/config/v1"
1010
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
1111
"github.com/openshift/cluster-network-operator/pkg/names"
12-
mcutil "github.com/openshift/cluster-network-operator/pkg/util/machineconfig"
1312
mcomcfgv1 "github.com/openshift/machine-config-operator/pkg/apihelpers"
1413
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1514
"k8s.io/apimachinery/pkg/labels"
@@ -140,18 +139,11 @@ func (status *StatusManager) SetFromMachineConfigPool(mcPools []mcfgv1.MachineCo
140139
// No degraded pools, so clear degraded status
141140
status.setNotDegraded(MachineConfig)
142141

143-
// Now check for progressing and process machine configs
144142
for role, machineConfigs := range status.renderedMachineConfigs {
145143
pools, err := status.findMachineConfigPoolsForLabel(mcPools, map[string]string{names.MachineConfigLabelRoleKey: role})
146144
if err != nil {
147145
klog.Errorf("failed to get machine config pools for the role %s: %v", role, err)
148146
}
149-
150-
progressingPool := status.isAnyMachineConfigPoolProgressing(pools)
151-
if progressingPool != "" {
152-
status.setProgressing(MachineConfig, "MachineConfig", fmt.Sprintf("%s machine config pool in progressing state", progressingPool))
153-
return nil
154-
}
155147
for _, pool := range pools {
156148
if pool.Spec.Paused {
157149
// When a machine config pool is in paused state, then it is expected that mco doesn't process any machine configs for the pool.
@@ -165,7 +157,7 @@ func (status *StatusManager) SetFromMachineConfigPool(mcPools []mcfgv1.MachineCo
165157
mcSet := sets.Set[string]{}
166158
mcSet.Insert(machineConfig)
167159
if mcsBeingRemoved, ok := status.machineConfigsBeingRemoved[role]; ok && mcsBeingRemoved.Has(machineConfig) {
168-
removed = mcutil.AreMachineConfigsRemovedFromPool(pool.Status, mcSet)
160+
removed = areMachineConfigsRemovedFromPoolSource(pool.Status, mcSet)
169161
if removed {
170162
status.machineConfigsBeingRemoved[role].Delete(machineConfig)
171163
// Delete map entry from status cache if role doesn't have machine configs. By deleting the entry,
@@ -183,7 +175,7 @@ func (status *StatusManager) SetFromMachineConfigPool(mcPools []mcfgv1.MachineCo
183175
}
184176
}
185177
} else {
186-
added = mcutil.AreMachineConfigsRenderedOnPool(pool.Status, mcSet)
178+
added = areMachineConfigsRenderedOnPoolSource(pool.Status, mcSet)
187179
}
188180
if !added || !removed {
189181
status.setProgressing(MachineConfig, "MachineConfig",
@@ -239,6 +231,22 @@ func (status *StatusManager) setLastRenderedMachineConfigState(renderedMachineCo
239231
return status.setAnnotation(context.TODO(), co, renderedMachineConfigAnnotation, &anno)
240232
}
241233

234+
func areMachineConfigsRenderedOnPoolSource(status mcfgv1.MachineConfigPoolStatus, machineConfigs sets.Set[string]) bool {
235+
sourceNames := sets.New[string]()
236+
for _, source := range status.Configuration.Source {
237+
sourceNames.Insert(source.Name)
238+
}
239+
return sourceNames.IsSuperset(machineConfigs)
240+
}
241+
242+
func areMachineConfigsRemovedFromPoolSource(status mcfgv1.MachineConfigPoolStatus, machineConfigs sets.Set[string]) bool {
243+
sourceNames := sets.New[string]()
244+
for _, source := range status.Configuration.Source {
245+
sourceNames.Insert(source.Name)
246+
}
247+
return !sourceNames.HasAny(machineConfigs.UnsortedList()...)
248+
}
249+
242250
func (status *StatusManager) isAnyMachineConfigPoolDegraded(pools []mcfgv1.MachineConfigPool) string {
243251
var degradedPool string
244252
for _, pool := range pools {
@@ -250,17 +258,6 @@ func (status *StatusManager) isAnyMachineConfigPoolDegraded(pools []mcfgv1.Machi
250258
return degradedPool
251259
}
252260

253-
func (status *StatusManager) isAnyMachineConfigPoolProgressing(pools []mcfgv1.MachineConfigPool) string {
254-
var progressingPool string
255-
for _, pool := range pools {
256-
if mcomcfgv1.IsMachineConfigPoolConditionTrue(pool.Status.Conditions, mcfgv1.MachineConfigPoolUpdating) {
257-
progressingPool = pool.Name
258-
break
259-
}
260-
}
261-
return progressingPool
262-
}
263-
264261
func (status *StatusManager) findMachineConfigPoolsForLabel(mcPools []mcfgv1.MachineConfigPool, mcLabel labels.Set) ([]mcfgv1.MachineConfigPool, error) {
265262
var mcps []mcfgv1.MachineConfigPool
266263
for _, mcPool := range mcPools {

0 commit comments

Comments
 (0)