-
Notifications
You must be signed in to change notification settings - Fork 480
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
Recreate managed resource secrets that have deletion timestamp #8812
Recreate managed resource secrets that have deletion timestamp #8812
Conversation
cmd/gardenlet/app/app.go
Outdated
return fmt.Errorf("failed to patch the original secret %w", err) | ||
} | ||
|
||
goneSecret := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: secret.Name, Namespace: secret.Namespace}} |
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.
Why is this needed? You could just continue using secret
in the WaitUntilResourceDeleted
call?
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.
WaitUntilResourceDeleted
uses the passed object and continuously modifies it via Get
calls. The initial thought was to not modify the passed secret to this function. Either way it is called with argument original.DeepCopy
so I guess we can apply your suggestion.
@rfranzke thanks for the review. I implemented most of the suggestions. My only concern with the |
Well, I assume that the API server can properly handle a few hundred create/update requests to secrets. This is a one time action anyways and only affects the seed API server and nothing else. I wouldn't be so afraid. These operations are fast and simple (no continuous listing required, etc.). If you still want to limit it, you can follow an easy approach like in https://github.com/gardener/gardener/blob/master/pkg/utils/gardener/secretsrotation/etcd.go#L105-L136 with the |
@rfranzke Thanks for the |
/retest-required |
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
/approve
LGTM label has been added. Git tree hash: 777fe881dd8ffec7c6af4967bc9f9306acbe6733
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rfranzke 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 |
How to categorize this PR?
/area quality
/kind cleanup
What this PR does / why we need it:
In #8398 a fix for unwanted garbage collection of MR secrets was provided, but in some systems there are still such secrets that have deletion timestamp. After #8745 the finalizer that protects them will be gone. This PR introduces a recreation step so gardenlet can recreate these secrets on startup.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
/invite @rfranzke
Thanks for reporting!
Release note: