Skip to content

Commit

Permalink
fix: add skips + breakout for DELETE_COMPLETE
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Jul 17, 2024
1 parent 8a16cf9 commit 0e904b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion magnum_cluster_api/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,12 @@ def update_nodegroups_status(

node_groups = []
for node_group in cluster.nodegroups:
if node_group.role == "master":
# NOTE(mnaser): Nothing to do if the node group is in `DELETE_COMPLETE`
# state and skip work if it's a master node group.
if (
node_group.role == "master"
and node_group.status == fields.ClusterStatus.DELETE_COMPLETE
):
continue

md = objects.MachineDeployment.for_node_group_or_none(
Expand All @@ -438,6 +443,7 @@ def update_nodegroups_status(
):
node_group.status = fields.ClusterStatus.DELETE_COMPLETE
node_group.save()
continue

md_is_running = (
md is not None and md.obj.get("status", {}).get("phase") == "Running"
Expand All @@ -452,6 +458,7 @@ def update_nodegroups_status(
):
node_group.status = fields.ClusterStatus.CREATE_COMPLETE
node_group.save()
continue

# Get list of all of the OpenStackMachine objects for this node group
machines = objects.OpenStackMachine.objects(
Expand Down Expand Up @@ -490,6 +497,7 @@ def update_nodegroups_status(
):
node_group.status = fields.ClusterStatus.UPDATE_COMPLETE
node_group.save()
continue

node_groups.append(node_group)

Expand Down

0 comments on commit 0e904b6

Please sign in to comment.