Browse Source

[fix] Sync nodegroup status before delete_complete

Magnum cluster deletion is not behaving as expected. While it appears to
delete successfully, _delete_complete routine in
magnum/drivers/heat/driver.py is never called because the status of
nodegroups have not had the chance to sync with Heat before
_check_delete_complete is called. As a result, for example, trustee user
accounts are left orphaned. This PS changes or order of activities so
that _delete_complete is invoked successfully.

Story: 2007965
Task: 40459

Change-Id: Ibadd5b57fe175bb0b100266e2dbcc2e1ea4efcf9
(cherry picked from commit 1cdc0628a28da32ef52324244a4c97b0794c2542)
changes/72/757772/1
Bharat Kunwar 5 months ago
committed by Pierre Riteau
parent
commit
e0a4683c08
2 changed files with 14 additions and 9 deletions
  1. +9
    -9
      magnum/drivers/heat/driver.py
  2. +5
    -0
      releasenotes/notes/ensure-delete-complete-2f9bb53616e1e02b.yaml

+ 9
- 9
magnum/drivers/heat/driver.py View File

@@ -493,15 +493,6 @@ class HeatPoller(object):
stack = self.openstack_client.heat().stacks.get(
self.nodegroup.stack_id, resolve_outputs=False)

# poll_and_check is detached and polling long time to check
# status, so another user/client can call delete cluster/stack.
if stack.stack_status == fields.ClusterStatus.DELETE_COMPLETE:
if self.nodegroup.is_default:
self._check_delete_complete()
else:
self.nodegroup.destroy()
return

if stack.stack_status in (fields.ClusterStatus.CREATE_COMPLETE,
fields.ClusterStatus.UPDATE_COMPLETE):
# Resolve all outputs if the stack is COMPLETE
@@ -516,6 +507,15 @@ class HeatPoller(object):
nodegroups=[self.nodegroup])
self._sync_cluster_status(stack)

# poll_and_check is detached and polling long time to check
# status, so another user/client can call delete cluster/stack.
if stack.stack_status == fields.ClusterStatus.DELETE_COMPLETE:
if self.nodegroup.is_default:
self._check_delete_complete()
else:
self.nodegroup.destroy()
return

if stack.stack_status in (fields.ClusterStatus.CREATE_FAILED,
fields.ClusterStatus.DELETE_FAILED,
fields.ClusterStatus.UPDATE_FAILED,


+ 5
- 0
releasenotes/notes/ensure-delete-complete-2f9bb53616e1e02b.yaml View File

@@ -0,0 +1,5 @@
---
fixes:
- |
Fixes a regression which left behind trustee user accounts and certificates
when a cluster is deleted.

Loading…
Cancel
Save