summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-29 21:57:08 +0200
committerGitHub <noreply@github.com>2019-07-29 21:57:08 +0200
commit7d635ac1c5ce61385dea009d29eceb90fea8db30 (patch)
treed8abdb860d316deea134dd1ba772ea8794c68b41
parent71bb2889ff7e4234a29e6440f8740699640d7773 (diff)
parent40bf0649afcb0bff839e5cb52b03099b4e16a539 (diff)
downloadpodman-7d635ac1c5ce61385dea009d29eceb90fea8db30.tar.gz
podman-7d635ac1c5ce61385dea009d29eceb90fea8db30.tar.bz2
podman-7d635ac1c5ce61385dea009d29eceb90fea8db30.zip
Merge pull request #3656 from jwhonce/wip/env
Fix commit --changes env=X=Y
-rw-r--r--cmd/podman/shared/create.go16
-rw-r--r--libpod/container_commit.go3
2 files changed, 12 insertions, 7 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index 9578eb17d..43b1b4067 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
- "github.com/containers/libpod/pkg/errorhandling"
"io"
"os"
"path/filepath"
@@ -18,6 +17,7 @@ import (
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/image"
ann "github.com/containers/libpod/pkg/annotations"
+ "github.com/containers/libpod/pkg/errorhandling"
"github.com/containers/libpod/pkg/inspect"
ns "github.com/containers/libpod/pkg/namespaces"
"github.com/containers/libpod/pkg/rootless"
@@ -77,7 +77,11 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod.
writer = os.Stderr
}
- newImage, err := runtime.ImageRuntime().New(ctx, c.InputArgs[0], rtc.SignaturePolicyPath, GetAuthFile(""), writer, nil, image.SigningOptions{}, false, nil)
+ name := ""
+ if len(c.InputArgs) != 0 {
+ name = c.InputArgs[0]
+ }
+ newImage, err := runtime.ImageRuntime().New(ctx, name, rtc.SignaturePolicyPath, GetAuthFile(""), writer, nil, image.SigningOptions{}, false, nil)
if err != nil {
return nil, nil, err
}
@@ -681,7 +685,7 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
DNSServers: c.StringSlice("dns"),
Entrypoint: entrypoint,
Env: env,
- //ExposedPorts: ports,
+ // ExposedPorts: ports,
GroupAdd: c.StringSlice("group-add"),
Hostname: c.String("hostname"),
HostAdd: c.StringSlice("add-host"),
@@ -693,16 +697,16 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
Image: imageName,
ImageID: imageID,
Interactive: c.Bool("interactive"),
- //IP6Address: c.String("ipv6"), // Not implemented yet - needs CNI support for static v6
+ // IP6Address: c.String("ipv6"), // Not implemented yet - needs CNI support for static v6
IPAddress: c.String("ip"),
Labels: labels,
- //LinkLocalIP: c.StringSlice("link-local-ip"), // Not implemented yet
+ // LinkLocalIP: c.StringSlice("link-local-ip"), // Not implemented yet
LogDriver: logDriver,
LogDriverOpt: c.StringSlice("log-opt"),
MacAddress: c.String("mac-address"),
Name: c.String("name"),
Network: network,
- //NetworkAlias: c.StringSlice("network-alias"), // Not implemented - does this make sense in Podman?
+ // NetworkAlias: c.StringSlice("network-alias"), // Not implemented - does this make sense in Podman?
IpcMode: ipcMode,
NetMode: netMode,
UtsMode: utsMode,
diff --git a/libpod/container_commit.go b/libpod/container_commit.go
index 17586bfad..8dfeee9b8 100644
--- a/libpod/container_commit.go
+++ b/libpod/container_commit.go
@@ -19,7 +19,7 @@ import (
// ContainerCommitOptions is a struct used to commit a container to an image
// It uses buildah's CommitOptions as a base. Long-term we might wish to
// add these to the buildah struct once buildah is more integrated with
-//libpod
+// libpod
type ContainerCommitOptions struct {
buildah.CommitOptions
Pause bool
@@ -177,6 +177,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
return nil, errors.Errorf("invalid env variable %q: not defined in your environment", name)
}
} else {
+ name = change[0]
val = strings.Join(change[1:], " ")
}
if !isEnvCleared { // Multiple values are valid, only clear once.