Browse Source

daemon: withLibnetwork(): use OCI-spec consts for namespaces

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 year ago
parent
commit
225691e258
1 changed files with 1 additions and 1 deletions
  1. 1 1
      daemon/oci_linux.go

+ 1 - 1
daemon/oci_linux.go

@@ -68,7 +68,7 @@ func withLibnetwork(daemon *Daemon, daemonCfg *dconfig.Config, c *container.Cont
 			s.Hooks = &specs.Hooks{}
 			s.Hooks = &specs.Hooks{}
 		}
 		}
 		for _, ns := range s.Linux.Namespaces {
 		for _, ns := range s.Linux.Namespaces {
-			if ns.Type == "network" && ns.Path == "" && !c.Config.NetworkDisabled {
+			if ns.Type == specs.NetworkNamespace && ns.Path == "" && !c.Config.NetworkDisabled {
 				target := filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe")
 				target := filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe")
 				shortNetCtlrID := stringid.TruncateID(daemon.netController.ID())
 				shortNetCtlrID := stringid.TruncateID(daemon.netController.ID())
 				s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{
 				s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{