Add Pod as an owner of a CiliumEndpoint and remove useless Delete#11195
Merged
Add Pod as an owner of a CiliumEndpoint and remove useless Delete#11195
Conversation
Member
Author
|
test-me-please |
215aa3d to
60765fa
Compare
Member
Author
|
test-me-please |
tgraf
suggested changes
Apr 29, 2020
Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: André Martins <andre@cilium.io>
During initialization, it is not required to delete the CEP as we will overwrite its status regardless of the state stored in k8s. Signed-off-by: André Martins <andre@cilium.io>
60765fa to
59a5141
Compare
As a CiliumEndpoint can't exist without a Pod, we should set the Pod as an Owner of a particular endpoint. This will allow CiliumEndpoints from being automatically GCed by K8s once the Pod is gone. Signed-off-by: André Martins <andre@cilium.io>
59a5141 to
8c9bbad
Compare
Member
Author
|
test-me-please |
tgraf
approved these changes
May 1, 2020
| } | ||
|
|
||
| scopedLog.Debug("Deleting CEP during an initialization") | ||
| err := ciliumClient.CiliumEndpoints(namespace).Delete(ctx, podName, meta_v1.DeleteOptions{}) |
Contributor
There was a problem hiding this comment.
I think this was done a long time ago when we changed the format of the CIliumEndpoint at the very beginning for this feature and this allowed to up and downgrade.
| // K8sNamespace is the Kubernetes namespace of the endpoint | ||
| K8sNamespace string | ||
|
|
||
| // pod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove Delete operation when starting up Cilium which removes the CiliumEndpoint in the k8s apiserver. This is unnecessary since CiliumEndpoint will be updated immediately afterwards.
As a CiliumEndpoint can't exist without a Pod, we should set the Pod as an Owner of a particular endpoint.
This will allow CiliumEndpoints from being automatically GCed by K8s once the Pod is gone.