forked from github/multus-cni
multus: fail if given pod UID does not match Kube API pod UID
If the runtime passes a pod UID via K8S_POD_UID (which both CRIO and containerd do as of mid-2021) then fail if the pod we get from the Kube API has a different UID. This would indicate that the pod was deleted and recreated while Multus was attempting to set up networking for the old pod instance's sandbox, and it's pointless to continue setting up a sandbox for a dead pod instance. Also pass the pod UID through to plugins so they can perform additional checking and validation on the pods they get from the Kube API. Signed-off-by: Dan Williams <dcbw@redhat.com>
This commit is contained in:
committed by
Tomofumi Hayashi
parent
392726842f
commit
cb19a22cb9
@@ -157,6 +157,7 @@ type K8sArgs struct {
|
||||
K8S_POD_NAME types.UnmarshallableString //revive:disable-line
|
||||
K8S_POD_NAMESPACE types.UnmarshallableString //revive:disable-line
|
||||
K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString //revive:disable-line
|
||||
K8S_POD_UID types.UnmarshallableString //revive:disable-line
|
||||
}
|
||||
|
||||
// ResourceInfo is struct to hold Pod device allocation information
|
||||
|
Reference in New Issue
Block a user