-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Adding cadcading deletion support for federated secrets #36296
Adding cadcading deletion support for federated secrets #36296
Conversation
baseSecret.Name) | ||
// Add the required finalizers before creating a secret in | ||
// underlying clusters. | ||
// This ensures that the dependent secrets are deleted in underlying |
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.
Update the comment.
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.
Done
// delete deletes the given secret or returns error if the deletion was not complete. | ||
func (secretcontroller *SecretController) delete(secret *api_v1.Secret) error { | ||
glog.V(3).Infof("Handling deletion of secret: %v", *secret) | ||
// Delete the secret from all underlying clusters. |
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.
Update the comment.
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 it
@@ -92,6 +95,11 @@ func TestSecretController(t *testing.T) { | |||
|
|||
// Test add federated secret. | |||
secretWatch.Add(&secret1) | |||
updatedSecret := GetSecretFromChan(secretUpdateChan) | |||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, deletionhelper.FinalizerDeleteFromUnderlyingClusters)) |
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.
Check for both finalizers.
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.
Done
LGTM. Update the comments, and update the assert in the e2e test. Feel free to self apply the label. |
59cbca1
to
9e360e8
Compare
Updated the code as per comments. |
@k8s-bot unit test this |
1 similar comment
@k8s-bot unit test this |
9e360e8
to
49a7d9c
Compare
@k8s-bot unit test this |
1 similar comment
@k8s-bot unit test this |
49a7d9c
to
ed1b037
Compare
Rebased |
Jenkins GCE etcd3 e2e failed for commit ed1b037402ade81aa84fa0322d1b537cb94e7949. Full PR test history. The magic incantation to run this job again is |
Jenkins Kubemark GCE e2e failed for commit ed1b037402ade81aa84fa0322d1b537cb94e7949. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GCE e2e failed for commit ed1b037402ade81aa84fa0322d1b537cb94e7949. Full PR test history. The magic incantation to run this job again is |
Jenkins GKE smoke e2e failed for commit ed1b037402ade81aa84fa0322d1b537cb94e7949. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE e2e failed for commit ed1b037402ade81aa84fa0322d1b537cb94e7949. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GKE smoke e2e failed for commit ed1b037402ade81aa84fa0322d1b537cb94e7949. Full PR test history. The magic incantation to run this job again is |
Jenkins verification failed for commit ed1b037402ade81aa84fa0322d1b537cb94e7949. Full PR test history. The magic incantation to run this job again is |
ed1b037
to
9cda48e
Compare
Jenkins unit/integration failed for commit 9cda48e4f9781d6ed7647e0a42e3586763cca9e0. Full PR test history. The magic incantation to run this job again is |
9cda48e
to
11ede23
Compare
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Release-czar approved post-code freeze merge--This was LGTMed and in the merge-queue at code freeze time for 1.5. Leaving 1.5 milestone to let it gets merged after code freeze. |
Automatic merge from submit-queue |
@nikhiljindal @pwittrock this is making test-go fail ~25% of the time (#36422). Can this be reverted if it's not an easy fix? |
Sorry just saw #36422. Am on it |
Ref #33612
Adding cascading deletion support for federated secrets.
The code is same as that for namespaces. Just ensuring that DeletionHelper functions are called at right places in secret_controller.
Also added e2e tests.
cc @kubernetes/sig-cluster-federation @caesarxuchao
This change is