diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-04-15 13:56:47 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-05-01 10:16:23 -0400 |
commit | 4540458a5e2809d2ecc2a1c6e67e9752529c1126 (patch) | |
tree | 32eb0e0da33cec3a7997d7076127fa05b900ce8a /cmd/podman | |
parent | 869466eb25a41ab0e6daf9bc6ab951d7300d3f9d (diff) | |
download | podman-4540458a5e2809d2ecc2a1c6e67e9752529c1126.tar.gz podman-4540458a5e2809d2ecc2a1c6e67e9752529c1126.tar.bz2 podman-4540458a5e2809d2ecc2a1c6e67e9752529c1126.zip |
Remove non-config fields from CreateConfig
The goal here is to keep only the configuration directly used to
build the container in CreateConfig, and scrub temporary state
and helpers that we need to generate. We'll keep those internally
in MakeContainerConfig.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/play_kube.go | 1 | ||||
-rw-r--r-- | cmd/podman/shared/create.go | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/cmd/podman/play_kube.go b/cmd/podman/play_kube.go index 967798399..2e51457c4 100644 --- a/cmd/podman/play_kube.go +++ b/cmd/podman/play_kube.go @@ -281,7 +281,6 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container // The default for MemorySwappiness is -1, not 0 containerConfig.Resources.MemorySwappiness = -1 - containerConfig.Runtime = runtime containerConfig.Image = containerYAML.Image containerConfig.ImageID = newImage.ID() containerConfig.Name = containerYAML.Name diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index a1b7cee1c..ab695bcf4 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -139,7 +139,7 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod. return ctr, createConfig, nil } -func parseSecurityOpt(config *cc.CreateConfig, securityOpts []string) error { +func parseSecurityOpt(config *cc.CreateConfig, securityOpts []string, runtime *libpod.Runtime) error { var ( labelOpts []string ) @@ -147,7 +147,7 @@ func parseSecurityOpt(config *cc.CreateConfig, securityOpts []string) error { if config.PidMode.IsHost() { labelOpts = append(labelOpts, label.DisableSecOpt()...) } else if config.PidMode.IsContainer() { - ctr, err := config.Runtime.LookupContainer(config.PidMode.Container()) + ctr, err := runtime.LookupContainer(config.PidMode.Container()) if err != nil { return errors.Wrapf(err, "container %q not found", config.PidMode.Container()) } @@ -161,7 +161,7 @@ func parseSecurityOpt(config *cc.CreateConfig, securityOpts []string) error { if config.IpcMode.IsHost() { labelOpts = append(labelOpts, label.DisableSecOpt()...) } else if config.IpcMode.IsContainer() { - ctr, err := config.Runtime.LookupContainer(config.IpcMode.Container()) + ctr, err := runtime.LookupContainer(config.IpcMode.Container()) if err != nil { return errors.Wrapf(err, "container %q not found", config.IpcMode.Container()) } @@ -604,7 +604,6 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. memorySwappiness := c.Int64("memory-swappiness") config := &cc.CreateConfig{ - Runtime: runtime, Annotations: annotations, BuiltinImgVolumes: ImageVolumes, ConmonPidFile: c.String("conmon-pidfile"), @@ -711,7 +710,7 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. if config.Privileged { config.LabelOpts = label.DisableSecOpt() } else { - if err := parseSecurityOpt(config, c.StringArray("security-opt")); err != nil { + if err := parseSecurityOpt(config, c.StringArray("security-opt"), runtime); err != nil { return nil, err } } |