summaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-15 12:54:36 -0400
committerGitHub <noreply@github.com>2020-06-15 12:54:36 -0400
commit10c6c806ea6d7830c248d9c89cd5ec3a7a515a63 (patch)
tree837474da079889daa027b66e5239915dd983f7ab /cmd/podman/common
parentb89729778c253f0eccd2dd762e5d0a6547aaea7d (diff)
parent6118ab494884eea62c388fa1536349f05cdac9d3 (diff)
downloadpodman-10c6c806ea6d7830c248d9c89cd5ec3a7a515a63.tar.gz
podman-10c6c806ea6d7830c248d9c89cd5ec3a7a515a63.tar.bz2
podman-10c6c806ea6d7830c248d9c89cd5ec3a7a515a63.zip
Merge pull request #6553 from vrothberg/replace
--replace for containers and pods
Diffstat (limited to 'cmd/podman/common')
-rw-r--r--cmd/podman/common/create.go5
-rw-r--r--cmd/podman/common/create_opts.go1
2 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index e79c5c20b..921cd5a71 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -373,6 +373,11 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"read-only-tmpfs", true,
"When running containers in read-only mode mount a read-write tmpfs on /run, /tmp and /var/tmp",
)
+ createFlags.BoolVar(
+ &cf.Replace,
+ "replace", false,
+ `If a container with the same name exists, replace it`,
+ )
createFlags.StringVar(
&cf.Restart,
"restart", "",
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 98dc6744c..49052704e 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -76,6 +76,7 @@ type ContainerCLIOpts struct {
ReadOnly bool
ReadOnlyTmpFS bool
Restart string
+ Replace bool
Rm bool
RootFS bool
SecurityOpt []string