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

Fix Network Namespace Bug For Ctr #1270

Merged
merged 1 commit into from
Feb 9, 2022
Merged

Commits on Jan 10, 2022

  1. Fix Network Namespace Bug For Ctr

    If you try and run a hypervisor isolated container through ctr
    (.\ctr.exe run --runtime io.containerd.runhcs.v1 --rm --isolated
    mcr.microsoft.com/windows/nanoserver:1809 xenon-test cmd /c "echo Hello
    World!") currently you'll get "ctr: failure while creating namespace for
    container: network namespace not found: unknown". The normal path through
    ctr is no network namespace is passed, so our shim will try and make one.
    The namespace was being created via `hns.CreateNamespace` which stores the
    ID of the namespace in all caps, however later on in the process when we
    go to add the namespace to the uvm we re-grab a namespace object via
    `hcn.GetNamespaceByID` which populates the Id field in all lowercase.
    
    When we originally store the namespace in our map of known namespaces we use
    the hns packages casing, and when we go to add any endpoints to the vm
    (there shouldn't be any anyways if we went through ctr and didn't provide --cni)
    then we'll fail to find the namespace due to a casing mismatch. We already create
    the namespace for cri interactions with the hcn package so this truthfully
    brings this fallback path in line.
    
    Signed-off-by: Daniel Canter <dcanter@microsoft.com>
    dcantah committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    e6bac22 View commit details
    Browse the repository at this point in the history