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

extract namespace from network annotation when checking for kubevirt related pod instance #141

Closed
wants to merge 1 commit into from

Commits on May 11, 2020

  1. 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 there is a multus netwrok annotation, and that 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 <ralavi@redhat.com>
    RamLavi committed May 11, 2020
    Configuration menu
    Copy the full SHA
    d8098ed View commit details
    Browse the repository at this point in the history