Skip to content

Commit 46e94e6

Browse files
committed
fix: do not block machine config updates if loadbalancer is down
This check doesn't make sense for the config updates. We are trying to address the case when the config has broken the API server and you try to revert it. All api servers are down and you can not revert it because all api servers are down. Signed-off-by: Artem Chernyshev <[email protected]> (cherry picked from commit a0d02ea)
1 parent 9a2ea7f commit 46e94e6

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

internal/backend/runtime/omni/controllers/omni/internal/machineset/control_planes_handler.go

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,30 @@ func ReconcileControlPlanes(ctx context.Context, rc *ReconciliationContext, etcd
3131
}), nil
3232
}
3333

34-
if !rc.LBHealthy() {
35-
return nil, nil
36-
}
37-
3834
// pending tearing down machines with finalizers should cancel any other operations
3935
if len(rc.GetTearingDownMachines()) > 0 {
4036
return nil, nil
4137
}
4238

43-
// do a single destroy
44-
for _, id := range rc.GetMachinesToTeardown() {
45-
clusterMachine, ok := rc.GetClusterMachine(id)
46-
if !ok {
47-
continue
48-
}
39+
if rc.LBHealthy() {
40+
// do a single destroy
41+
for _, id := range rc.GetMachinesToTeardown() {
42+
clusterMachine, ok := rc.GetClusterMachine(id)
43+
if !ok {
44+
continue
45+
}
4946

50-
etcdStatus, err := etcdStatusGetter(ctx)
51-
if err != nil {
52-
return nil, err
53-
}
47+
etcdStatus, err := etcdStatusGetter(ctx)
48+
if err != nil {
49+
return nil, err
50+
}
5451

55-
if err := check.CanScaleDown(etcdStatus, clusterMachine); err != nil {
56-
return nil, err
57-
}
52+
if err := check.CanScaleDown(etcdStatus, clusterMachine); err != nil {
53+
return nil, err
54+
}
5855

59-
return []Operation{&Teardown{ID: id}}, nil
56+
return []Operation{&Teardown{ID: id}}, nil
57+
}
6058
}
6159

6260
// do a single update

0 commit comments

Comments
 (0)