-
Notifications
You must be signed in to change notification settings - Fork 43
Delete replication group to wait for delete completion #34
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 replication group to wait for delete completion #34
Conversation
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.
Looking great @kumargauravsharma but I think you may have forgotten to git add a file...? :)
} | ||
status := *r.ko.Status.Status | ||
return status == "deleting" | ||
} |
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.
👍
@@ -0,0 +1,4 @@ | |||
if isDeleting(r) { | |||
return requeueWaitWhileDeleting |
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.
Did you need to git add
a conditions.go
file? :) I don't see where requeueWaitWhileDeleting
is defined?
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.
requeueWaitWhileDeleting
is defined in hooks.go
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.
doh! sorry, not sure how I missed that :)
path: Events | ||
AuthToken: | ||
is_secret: true | ||
hooks: |
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.
Not sure but maybe you need a sdk_find_post_set_output
hook as well? (similar to dk_delete_pre_build_request.go.tpl
)
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.
It was not needed.
I have a upcoming separate PR to patch resource which is being deleted, so that kubectl describe provides latest state of the resource as it gets deleted.
But that is independent of this PR.
generator.yaml
Outdated
sdk_delete_pre_build_request: | ||
template_path: hooks/sdk_delete_pre_build_request.go.tpl | ||
sdk_delete_post_request: | ||
template_path: hooks/sdk_delete_post_request.go.tpl |
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.
template_path: hooks/sdk_delete_post_request.go.tpl | |
template_path: hooks/sdk_delete_post_request.go.tpl |
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.
Removed the extra space.
be34d9e
to
984b927
Compare
984b927
to
1ab7e69
Compare
1ab7e69
to
c004a76
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: echen-98, jaypipes, kumargauravsharma, nmvk 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 |
@@ -0,0 +1,8 @@ | |||
if respErr == nil { | |||
if foundResource, err := rm.sdkFind(ctx, r); err != ackerr.NotFound { |
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.
If a DELETE operation on ReplicationGroup has returned no error, doesn't this mean that the resource will always be in a deleting
status? Is it necessary to do another sdkFind() operation here?
Further, if a DELETE operation on ReplicationGroup returns no error, is there any chance that the ReplicationGroup can end up not being deleted in the backend Elasticache service? If there is no chance of this, is it really necessary to do anything here other than return nil and let the elasticache-controller reconcile the resource and remove its finalizer in cleanup()
and get rid of the CR on the k8s side?
Issue #, if available:
Replication group delete takes some time to delete while
kubectl delete -f replication_group.yaml
removes the custom resource record from cluster.Description of changes:
This PR adds logic inside
sdk::sdkDelete()
to requeue reconcile while replication group is deleting.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.