diff options
Diffstat (limited to 'cmd/podman/build.go')
-rw-r--r-- | cmd/podman/build.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd/podman/build.go b/cmd/podman/build.go index fbf85fc97..885f2ac51 100644 --- a/cmd/podman/build.go +++ b/cmd/podman/build.go @@ -116,21 +116,22 @@ func getContainerfiles(files []string) []string { func getNsValues(c *cliconfig.BuildValues) ([]buildah.NamespaceOption, error) { var ret []buildah.NamespaceOption if c.Network != "" { - if c.Network == "host" { + switch { + case c.Network == "host": ret = append(ret, buildah.NamespaceOption{ Name: string(specs.NetworkNamespace), Host: true, }) - } else if c.Network == "container" { + case c.Network == "container": ret = append(ret, buildah.NamespaceOption{ Name: string(specs.NetworkNamespace), }) - } else if c.Network[0] == '/' { + case c.Network[0] == '/': ret = append(ret, buildah.NamespaceOption{ Name: string(specs.NetworkNamespace), Path: c.Network, }) - } else { + default: return nil, fmt.Errorf("unsupported configuration network=%s", c.Network) } } @@ -375,7 +376,8 @@ func buildCmd(c *cliconfig.BuildValues) error { }, Target: c.Target, } - return runtime.Build(getContext(), c, options, containerfiles) + _, _, err = runtime.Build(getContext(), c, options, containerfiles) + return err } // useLayers returns false if BUILDAH_LAYERS is set to "0" or "false" |