forked from cri-o/ocicni
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ocicni: pass a Pod UID down to CNI plugins as K8S_POD_UID
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 <[email protected]>
- Loading branch information
Showing
3 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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