Skip to content

Commit

Permalink
Fix KeyError: 'status' for node group updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yaguangtang authored Jul 4, 2024
1 parent e287c45 commit d1a3ae4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magnum_cluster_api/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ def update_cluster_control_plane_status(
if generation > 1:
action = "UPDATE"

ready = kcp.obj["status"].get("ready", False)
failure_message = kcp.obj["status"].get("failureMessage")
ready = kcp.obj.get("status", {}).get("ready", False)
failure_message = kcp.obj.get("status", {}).get("failureMessage")

updated_replicas = kcp.obj["status"].get("updatedReplicas")
replicas = kcp.obj["status"].get("replicas")
updated_replicas = kcp.obj.get("status", {}).get("updatedReplicas")
replicas = kcp.obj.get("status", {}).get("replicas")

if updated_replicas != replicas:
nodegroup.status = f"{action}_IN_PROGRESS"
Expand Down

0 comments on commit d1a3ae4

Please sign in to comment.