-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ocicni: pass a Pod UID down to CNI plugins as K8S_POD_UID #91
Conversation
@dcbw: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dcbw 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 |
If a pod is deleted from the Kube API while a SetUpPod() call is ongoing it would be nice if the CNI plugin could easily figure that out and exit early. Plugins can watch the Kube API for pod events, but there is a race where the pod could have been deleted + recreated before the plugin is executed and sets up the watches. Since each new pod object will have a different UID, pass the UID we get from the runtime down to the CNI plugins so they can compare the UID they receive from ocicni with one they read from the Kube API. If the two UIDs are different, that means the pod was deleted + recreated before or during the plugin execution, and the plugin may wish to exit early since any information it read from the Kube API and used to configure sandbox resources may be out-of-date. Signed-off-by: Dan Williams <dcbw@redhat.com>
Pull Request Test Coverage Report for Build 927024188
💛 - Coveralls |
a75bfed
to
1ea8db5
Compare
Name string | ||
// Namespace is the namespace of the sandbox. | ||
// Namespace is the namespace of the pod. | ||
Namespace string |
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.
Nit: Isn't Namespace still the name of the sandbox?
/lgtm |
If a pod is deleted from the Kube API while a SetUpPod() call
is ongoing it would be nice if the CNI plugin could easily
figure that out and exit early. Plugins can watch the Kube API
for pod events, but there is a race where the pod could have
been deleted + recreated before the plugin is executed and
sets up the watches.
Since each new pod object will have a different UID, pass
the UID we get from the runtime down to the CNI plugins so
they can compare the UID they receive from ocicni with one
they read from the Kube API. If the two UIDs are different,
that means the pod was deleted + recreated before the plugin
ran, and the plugin may wish to exit early.
@trozet @mrunalp @mccv1r0