fix(network): distinguish missing container iface from setup failures - #865
Open
Vi-shub wants to merge 1 commit into
Open
fix(network): distinguish missing container iface from setup failures#865Vi-shub wants to merge 1 commit into
Vi-shub wants to merge 1 commit into
Conversation
Propagate real NetworkSetup failures from SetupNet, while treating ErrNoContainerNetwork (no iface in netns) as a non-fatal no-network case. Fixes: urunc-dev#417 Signed-off-by: Vi-shub <smsharma3121@gmail.com>
✅ Deploy Preview for urunc canceled.
|
Author
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
SetupNetpreviously logged and ignored allNetworkSetuperrors, so real failures (TAP creation, TC rules, permissions) could leave a container running without networking.This change follows the guidance on #417:
network.ErrNoContainerNetworkfor the "no suitable interface in the netns" case (ctr /--network none).discoverContainerIfacereturns that sentinel.SetupNetcontinues only whenerrors.Is(err, ErrNoContainerNetwork); all other errors are returned to the caller.%w.Related issues
How was this tested?
make test_network(includesTestErrNoContainerNetworkIsDetectableWhenWrapped)sudo nerdctl run --rm --network none --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/hello-qemu-unikraft:latest→ Hello worldsudo nerdctl run -d --name urunc-nginx --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/nginx-qemu-unikraft-initrd:latest→ curl to container IP succeededLLM usage
Claude assisted with drafting the PR creation; I reviewed and verified the logic against the discussion on #417 and tested locally as above.
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).