Skip to content

Commit

Permalink
fix: do not block machine config updates if loadbalancer is down
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Unix4ever committed May 15, 2024
1 parent 9a2ea7f commit 46e94e6
Showing 1 changed file with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,30 @@ func ReconcileControlPlanes(ctx context.Context, rc *ReconciliationContext, etcd
}), nil
}

if !rc.LBHealthy() {
return nil, nil
}

// pending tearing down machines with finalizers should cancel any other operations
if len(rc.GetTearingDownMachines()) > 0 {
return nil, nil
}

// do a single destroy
for _, id := range rc.GetMachinesToTeardown() {
clusterMachine, ok := rc.GetClusterMachine(id)
if !ok {
continue
}
if rc.LBHealthy() {
// do a single destroy
for _, id := range rc.GetMachinesToTeardown() {
clusterMachine, ok := rc.GetClusterMachine(id)
if !ok {
continue
}

etcdStatus, err := etcdStatusGetter(ctx)
if err != nil {
return nil, err
}
etcdStatus, err := etcdStatusGetter(ctx)
if err != nil {
return nil, err
}

if err := check.CanScaleDown(etcdStatus, clusterMachine); err != nil {
return nil, err
}
if err := check.CanScaleDown(etcdStatus, clusterMachine); err != nil {
return nil, err
}

return []Operation{&Teardown{ID: id}}, nil
return []Operation{&Teardown{ID: id}}, nil
}
}

// do a single update
Expand Down

0 comments on commit 46e94e6

Please sign in to comment.