Skip to content
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

vpc-shared-eni: Remove call to get Pod from API Server in DEL command #46

Merged
merged 2 commits into from
Aug 6, 2020

Conversation

abhipth
Copy link
Contributor

@abhipth abhipth commented Aug 5, 2020

As suggested by @ofiliz, refactoring the code in a cleaner way with additional comments explaining the reason for the change.

Description of changes:

We don't need to query the API Server on DEL command as we get the
Endpoint details using the container ID. We only query the API Server
on ADD command to get the IP Address from the Pod's Annotation.

Note: IP Address information will be required for EKS Linux node which
are not supported yet.

Resolves: #42

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

We don't need to query the API Server on DEL command as we get the
Endpoint details using the container ID. We only query the API Server
on ADD comand to get the IP Address from the Pod's Annotation.

Note: IP Address information will be required for EKS Linux node which
are not supported yet.

Resolves: aws#42
@abhipth abhipth requested review from ofiliz and vsiddharth and removed request for ofiliz August 5, 2020 23:42
// The only additional information we need to query from API server is the pod IP address,
// which is required only for ADD commands. Also the API server may have deleted the pod
// object already in the DEL path.
if !isAddCmd || args == nil || args.Args == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have this block at line 75 (right after populating the kc fields), so that the namespace, podname and podinfracontainerid are available also in the DEL path. I understand they are not currently used, so this is more for completeness rather than functional correctness. Not a big deal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, fixed it in the next commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IP Allocation Issues
2 participants