Browse Source

[k8s] Fix PreDeletionFailed if Heat stack is missing

When a stack has already been deleted, the pre-deletion tries to check
for loadbalancer for stack_id=None which returns PreDeletionFailed
exception. This patch addresses this issue.

Change-Id: Id7a9c5080633bca411398b7989026004e74ccb65
Story: 2007657
Task: 39783
changes/04/728304/2
Bharat Kunwar 2 years ago
parent
commit
f5d32eb51c
  1. 5
      magnum/common/octavia.py

5
magnum/common/octavia.py

@ -99,6 +99,11 @@ def delete_loadbalancers(context, cluster):
octavia_client_adm, remove_fip=True)
candidates.update(deleted)
# NOTE (brtknr): If stack has been deleted, cluster fails to delete
# because stack_id resolves to None. Return if that is the case.
if not cluster.stack_id:
return
# Get load balancers created for Kubernetes api/etcd
lbs = []
lb_resources = heat_client.resources.list(

Loading…
Cancel
Save