Skip to content

Commit d6d6527

Browse files
authored
Merge pull request moby#51952 from thaJeztah/use_ns_consts
daemon/pkg/plugin/v2: use namespace consts
2 parents d5fd0c5 + d7218ec commit d6d6527

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

daemon/pkg/plugin/v2/plugin_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (p *Plugin) InitSpec(execRoot string) (*specs.Spec, error) {
5555
if p.PluginObj.Config.Network.Type != "" {
5656
// TODO: if net == bridge, use libnetwork controller to create a new plugin-specific bridge, bind mount /etc/hosts and /etc/resolv.conf look at the docker code (allocateNetwork, initialize)
5757
if p.PluginObj.Config.Network.Type == "host" {
58-
oci.RemoveNamespace(&s, specs.LinuxNamespaceType("network"))
58+
oci.RemoveNamespace(&s, specs.NetworkNamespace)
5959
}
6060
etcHosts := "/etc/hosts"
6161
resolvConf := "/etc/resolv.conf"
@@ -74,11 +74,11 @@ func (p *Plugin) InitSpec(execRoot string) (*specs.Spec, error) {
7474
})
7575
}
7676
if p.PluginObj.Config.PidHost {
77-
oci.RemoveNamespace(&s, specs.LinuxNamespaceType("pid"))
77+
oci.RemoveNamespace(&s, specs.PIDNamespace)
7878
}
7979

8080
if p.PluginObj.Config.IpcHost {
81-
oci.RemoveNamespace(&s, specs.LinuxNamespaceType("ipc"))
81+
oci.RemoveNamespace(&s, specs.IPCNamespace)
8282
}
8383

8484
for _, mnt := range mounts {

0 commit comments

Comments
 (0)