summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-12-18 11:44:19 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2018-12-21 15:59:34 -0500
commitc657dc4fdbca4b331d69e0910261e2cb11e2a629 (patch)
treefa75b6ecfbaf7c3c85ab7548fe1ac29d1612cf47 /cmd
parentfe186c6ebba95db89463f38c6aa0f0dcc104a249 (diff)
downloadpodman-c657dc4fdbca4b331d69e0910261e2cb11e2a629.tar.gz
podman-c657dc4fdbca4b331d69e0910261e2cb11e2a629.tar.bz2
podman-c657dc4fdbca4b331d69e0910261e2cb11e2a629.zip
Switch all referencs to image.ContainerConfig to image.Config
This will more closely match what Docker is doing. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/create.go22
-rw-r--r--cmd/podman/docker/types.go10
-rw-r--r--cmd/podman/run_test.go18
-rw-r--r--cmd/podman/shared/container.go4
4 files changed, 27 insertions, 27 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index 1425892cc..dae429047 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -344,7 +344,7 @@ func configureEntrypoint(c *cli.Context, data *inspect.ImageData) []string {
return []string{c.String("entrypoint")}
}
if data != nil {
- return data.ContainerConfig.Entrypoint
+ return data.Config.Entrypoint
}
return entrypoint
}
@@ -474,7 +474,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
// EXPOSED PORTS
var portBindings map[nat.Port][]nat.PortBinding
if data != nil {
- portBindings, err = cc.ExposedPorts(c.StringSlice("expose"), c.StringSlice("publish"), c.Bool("publish-all"), data.ContainerConfig.ExposedPorts)
+ portBindings, err = cc.ExposedPorts(c.StringSlice("expose"), c.StringSlice("publish"), c.Bool("publish-all"), data.Config.ExposedPorts)
if err != nil {
return nil, err
}
@@ -567,7 +567,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
if data == nil {
user = "0"
} else {
- user = data.ContainerConfig.User
+ user = data.Config.User
}
}
@@ -575,7 +575,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
stopSignal := syscall.SIGTERM
signalString := ""
if data != nil {
- signalString = data.ContainerConfig.StopSignal
+ signalString = data.Config.StopSignal
}
if c.IsSet("stop-signal") {
signalString = c.String("stop-signal")
@@ -590,7 +590,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
// ENVIRONMENT VARIABLES
env := defaultEnvVariables
if data != nil {
- for _, e := range data.ContainerConfig.Env {
+ for _, e := range data.Config.Env {
split := strings.SplitN(e, "=", 2)
if len(split) > 1 {
env[split[0]] = split[1]
@@ -609,7 +609,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
return nil, errors.Wrapf(err, "unable to process labels")
}
if data != nil {
- for key, val := range data.ContainerConfig.Labels {
+ for key, val := range data.Config.Labels {
if _, ok := labels[key]; !ok {
labels[key] = val
}
@@ -643,8 +643,8 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
workDir := "/"
if c.IsSet("workdir") || c.IsSet("w") {
workDir = c.String("workdir")
- } else if data != nil && data.ContainerConfig.WorkingDir != "" {
- workDir = data.ContainerConfig.WorkingDir
+ } else if data != nil && data.Config.WorkingDir != "" {
+ workDir = data.Config.WorkingDir
}
entrypoint := configureEntrypoint(c, data)
@@ -656,9 +656,9 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
if len(inputCommand) > 0 {
// User command overrides data CMD
command = append(command, inputCommand...)
- } else if data != nil && len(data.ContainerConfig.Cmd) > 0 && !c.IsSet("entrypoint") {
+ } else if data != nil && len(data.Config.Cmd) > 0 && !c.IsSet("entrypoint") {
// If not user command, add CMD
- command = append(command, data.ContainerConfig.Cmd...)
+ command = append(command, data.Config.Cmd...)
}
if data != nil && len(command) == 0 {
@@ -697,7 +697,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
var ImageVolumes map[string]struct{}
if data != nil {
- ImageVolumes = data.ContainerConfig.Volumes
+ ImageVolumes = data.Config.Volumes
}
var imageVolType = map[string]string{
"bind": "",
diff --git a/cmd/podman/docker/types.go b/cmd/podman/docker/types.go
index a7e456554..90349a31c 100644
--- a/cmd/podman/docker/types.go
+++ b/cmd/podman/docker/types.go
@@ -125,11 +125,11 @@ type Config struct {
// don't result in runnable images on their own.
// github.com/docker/distribution/manifest/schema1/config_builder.go
type V1Compatibility struct {
- ID string `json:"id"`
- Parent string `json:"parent,omitempty"`
- Comment string `json:"comment,omitempty"`
- Created time.Time `json:"created"`
- ContainerConfig struct {
+ ID string `json:"id"`
+ Parent string `json:"parent,omitempty"`
+ Comment string `json:"comment,omitempty"`
+ Created time.Time `json:"created"`
+ Config struct {
Cmd []string
} `json:"container_config,omitempty"`
Author string `json:"author,omitempty"`
diff --git a/cmd/podman/run_test.go b/cmd/podman/run_test.go
index 079e570aa..33c0a4bfe 100644
--- a/cmd/podman/run_test.go
+++ b/cmd/podman/run_test.go
@@ -39,15 +39,15 @@ func generateAlpineImageData() *inspect.ImageData {
}
data := &inspect.ImageData{
- ID: "e21c333399e0aeedfd70e8827c9fba3f8e9b170ef8a48a29945eb7702bf6aa5f",
- RepoTags: []string{"docker.io/library/alpine:latest"},
- RepoDigests: []string{"docker.io/library/alpine@sha256:5cb04fce748f576d7b72a37850641de8bd725365519673c643ef2d14819b42c6"},
- Comment: "Created:2017-12-01 18:48:48.949613376 +0000",
- Author: "",
- Architecture: "amd64",
- Os: "linux",
- Version: "17.06.2-ce",
- ContainerConfig: config,
+ ID: "e21c333399e0aeedfd70e8827c9fba3f8e9b170ef8a48a29945eb7702bf6aa5f",
+ RepoTags: []string{"docker.io/library/alpine:latest"},
+ RepoDigests: []string{"docker.io/library/alpine@sha256:5cb04fce748f576d7b72a37850641de8bd725365519673c643ef2d14819b42c6"},
+ Comment: "Created:2017-12-01 18:48:48.949613376 +0000",
+ Author: "",
+ Architecture: "amd64",
+ Os: "linux",
+ Version: "17.06.2-ce",
+ Config: config,
}
return data
}
diff --git a/cmd/podman/shared/container.go b/cmd/podman/shared/container.go
index 6236d19b4..30beb4a49 100644
--- a/cmd/podman/shared/container.go
+++ b/cmd/podman/shared/container.go
@@ -51,7 +51,7 @@ type PsOptions struct {
// BatchContainerStruct is the return obkect from BatchContainer and contains
// container related information
type BatchContainerStruct struct {
- ConConfig *libpod.ContainerConfig
+ ConConfig *libpod.Config
ConState libpod.ContainerStatus
ExitCode int32
Exited bool
@@ -328,7 +328,7 @@ func PBatch(containers []*libpod.Container, workers int, opts PsOptions) []PsCon
// locks.
func BatchContainerOp(ctr *libpod.Container, opts PsOptions) (BatchContainerStruct, error) {
var (
- conConfig *libpod.ContainerConfig
+ conConfig *libpod.Config
conState libpod.ContainerStatus
err error
exitCode int32