-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete NovaCell cr only when deletion job pass #917
base: main
Are you sure you want to change the base?
Delete NovaCell cr only when deletion job pass #917
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrkisaolamb The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
if result == nova.CellDeleteComplete { | ||
Log.Info("Cell deleted", "cell", cr.Spec.CellName) | ||
delete(instance.Status.RegisteredCells, cr.Name) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if the result is not CellDeleteComplete then we return success from the reconciler below and allowing the NovaCell object to be deleted, but we keep the nova.Status.RegisteredCells entry. However when the job finally finishes and a new reconciler starts on nova controller the novaCellList above will not containt the NovaCell CR any more so the nova controller will not cleanup the RegisteredCells entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I added additional loop to check if registered cell job was sucess to ensure that we have correct status
@@ -718,22 +720,22 @@ func (r *NovaReconciler) ensureCellDeleted( | |||
|
|||
_, err = job.DoJob(ctx, h) | |||
if err != nil { | |||
return err | |||
return nova.CellDeleteFailed, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to check the result of the DoJob to see if the deletion job is still running and return to the caller if so.
@@ -96,6 +96,12 @@ const ( | |||
// CellComputeDiscoveryReady indicates that all NovaComputes in cell reached the Ready status and | |||
// the hosts in the cell have been successfully discovered | |||
CellComputeDiscoveryReady CellDeploymentStatus = iota | |||
// CellDeleteInProgress indicates that the NovaCell deletion is in progress | |||
CellDeleteInProgress CellDeploymentStatus = iota |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right we need in progress indication. You however missed to use this status.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I missed this somehow, now value is used in jobs checks
1a46e05
to
6447385
Compare
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3e56241f2d694cbfbd56fc77a8ec26aa ✔️ openstack-meta-content-provider SUCCESS in 2h 42m 09s |
resolve: https://issues.redhat.com/browse/OSPRH-12582