summaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorJordan Webb <jordemort@github.com>2019-06-14 09:42:34 -0500
committerJordan Webb <jordemort@github.com>2019-06-14 09:43:36 -0500
commitd2d57517d7d2a0f3ccbdf4bff4e7a9a24dd1f4fb (patch)
treed90eca92b474c1911eebd835e74d695b483b9bea /pkg/util
parent1322b41aa09d9cd9c4a51a7b69ff0e92df37a90b (diff)
downloadpodman-d2d57517d7d2a0f3ccbdf4bff4e7a9a24dd1f4fb.tar.gz
podman-d2d57517d7d2a0f3ccbdf4bff4e7a9a24dd1f4fb.tar.bz2
podman-d2d57517d7d2a0f3ccbdf4bff4e7a9a24dd1f4fb.zip
Fix ENV parsing on `podman import`
Signed-off-by: Jordan Webb <jordemort@github.com>
Diffstat (limited to 'pkg/util')
-rw-r--r--pkg/util/utils.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index a074f276c..61cdbbf38 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -99,7 +99,10 @@ func GetImageConfig(changes []string) (v1.ImageConfig, error) {
var st struct{}
exposedPorts[pair[1]] = st
case "ENV":
- env = append(env, pair[1])
+ if len(pair) < 3 {
+ return v1.ImageConfig{}, errors.Errorf("no value given for environment variable %q", pair[1])
+ }
+ env = append(env, strings.Join(pair[1:], "="))
case "ENTRYPOINT":
entrypoint = append(entrypoint, pair[1])
case "CMD":