-
Notifications
You must be signed in to change notification settings - Fork 604
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
rootless: fix CONTAINERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=slirp4netns #140
Conversation
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
…ns port driver Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
…t driver Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
54f9ade
to
6f987c6
Compare
f9c792c
to
2949e3a
Compare
…irp4netns Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2949e3a
to
52b87a4
Compare
// this is fine | ||
} else { | ||
if portDriverDisallowsLoopbackChildIP { | ||
p.HostIP = childIP.String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it OK that childIP == nil
enters this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can’t be nil when portDriverDisallowsLoopbackChildIP is true
// For rootless, we need to modify the hostIP that is not bindable in the child namespace. | ||
// https: //github.com/containerd/nerdctl/issues/88 | ||
// | ||
// We must NOT modify opts.ports here, because we use the unmodified opts.ports for | ||
// interaction with RootlessKit API. | ||
ports := make([]cni.PortMapping, len(opts.ports)) | ||
for i, p := range opts.ports { | ||
if hostIP := net.ParseIP(p.HostIP); hostIP != nil { | ||
if hostIP := net.ParseIP(p.HostIP); hostIP != nil && !hostIP.IsUnspecified() { | ||
// loopback address is always bindable in the child namespace, but other addresses are unlikely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
not always bindable
? (i.e. loopback is not bindable when portDriverDisallowsLoopbackChildIP == true
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bindable but not forwardable
No description provided.