Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract namespace from network annotation when cheking for kubevirt r…
…elated pod instance when running a vm, a virt-launcher pod is spawned. This pod should be ignored by kubemacpool, since the mac was already allocated during the creation of the vm. This is implemented in isRelatedToKubevirt(). Specifically, it does this by checking if the vm self link is valid. The link required the vm's namespace. Currently, kubemacpool uses the pod's own namespace in order to construct this link. This doesn't work - because from some reason the pod isn't received with any namespace assigned to it. Hence, the pod to be treated as a standalone pod, and thus rejected. In this commit, we switch to taking the namespace from the pod's annotation, that consist the network's namespace. This is introduced with selectNamespaceFromNetworks(), which goes over the pod's multus.NetworkSelectionElement annotation (if exists), and extracts the namespace form there. We assume that in this case there could only be one namespace for all the multus networks. Signed-off-by: Ram Lavi <[email protected]>
- Loading branch information