mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: don't create an empty network namespace if NetworkHost is set
With this change, we will be able to run runsc do in a host network namespace. PiperOrigin-RevId: 246436660 Change-Id: I8ea18b1053c88fe2feed74239b915fe7a151ce34
This commit is contained in:
@@ -472,6 +472,8 @@ func (s *Sandbox) createSandboxProcess(spec *specs.Spec, conf *boot.Config, bund
|
||||
if ns, ok := specutils.GetNS(specs.NetworkNamespace, spec); ok && conf.Network != boot.NetworkNone {
|
||||
log.Infof("Sandbox will be started in the container's network namespace: %+v", ns)
|
||||
nss = append(nss, ns)
|
||||
} else if conf.Network == boot.NetworkHost {
|
||||
log.Infof("Sandbox will be started in the host network namespace")
|
||||
} else {
|
||||
log.Infof("Sandbox will be started in new network namespace")
|
||||
nss = append(nss, specs.LinuxNamespace{Type: specs.NetworkNamespace})
|
||||
|
||||
Reference in New Issue
Block a user