瀏覽代碼

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 年之前
父節點
當前提交
225691e258
共有 1 個文件被更改,包括 1 次插入1 次删除
  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{}
 		}
 		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")
 				shortNetCtlrID := stringid.TruncateID(daemon.netController.ID())
 				s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{