summaryrefslogtreecommitdiff
path: root/libpod/container_inspect.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r--libpod/container_inspect.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index 3f4ab394f..01f2d93bd 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -1214,11 +1214,12 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named
// Network mode parsing.
networkMode := ""
- if c.config.CreateNetNS {
+ switch {
+ case c.config.CreateNetNS:
networkMode = "default"
- } else if c.config.NetNsCtr != "" {
+ case c.config.NetNsCtr != "":
networkMode = fmt.Sprintf("container:%s", c.config.NetNsCtr)
- } else {
+ default:
// Find the spec's network namespace.
// If there is none, it's host networking.
// If there is one and it has a path, it's "ns:".