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
Enhahance Terraformer.IsStateEmpty to check for presence of terraformer finalizer #3423
Enhahance Terraformer.IsStateEmpty to check for presence of terraformer finalizer #3423
Conversation
ccb44a6
to
3edf432
Compare
3edf432
to
6deb49f
Compare
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.
/lgtm
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.
Wouldn't a better approach be to make the extensions not skip the destruction in case the state is already empty and rather let the Terraformer remove the finalizers that it previously added?
6deb49f
to
ac61999
Compare
I believe It was introduced on purpose, for example provider-aws. Now the terraformer finalizer has broken this shortcut, and from my point of view the correct solution was to enhance the CleanupConfiguration. |
The Terraformer library is not dealing with the finalizer yet and should not start doing so, I believe. It should rather properly instrument the Terraformer - now that we have this new behaviour. |
I do not know all the details here, but why would the extensions remove a finalized from the terraformer? Wouldnt it be better to fix the terraformer to ensure the finalizer is removed from all the secrets (like @rfranzke suggests)? The extension would
Is this to make sure that the terraformer pod is re-created and removes the finalized? How is this related to the LB cleanup? |
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.
/lgtm
fe69e7f
to
5a93c66
Compare
5a93c66
to
8133868
Compare
8133868
to
2381883
Compare
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.
/lgtm
How to categorize this PR?
/kind bug
/priority normal
What this PR does / why we need it:
After gardener/terraformer#65 the terraform finalizers are removed at the end of a successful
destroy
. However, the finalizer deletion can be rejected for some reason by the API and the whole operation needs to executed again. At this point, most of the extensions skips to run adestroy
pod because of empty state, ref: https://github.com/gardener/gardener-extension-provider-aws/blob/d4c1eaf8590296add7a4bca19903b6eee3cd293b/pkg/controller/infrastructure/actuator_delete.go#L62-L65, hence there is no controller to remove the finalizer.Update:
Now the
IsStateEmpty
check is enhanced to also verify for presence of the terraformer finalizer.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Thanks @ialidzhikov for spotting it.
Release note: