From 1492f3c936a0f6180db61a6500371aceebc37e39 Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Fri, 2 Oct 2020 21:56:04 +0800 Subject: --rm option shold conflicts with --restart Signed-off-by: zhangguanzhang --- cmd/podman/common/createparse.go | 2 +- cmd/podman/common/specgen.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/podman') diff --git a/cmd/podman/common/createparse.go b/cmd/podman/common/createparse.go index 059f9050f..09ee5aa0c 100644 --- a/cmd/podman/common/createparse.go +++ b/cmd/podman/common/createparse.go @@ -10,7 +10,7 @@ import ( func (c *ContainerCLIOpts) validate() error { var () if c.Rm && c.Restart != "" && c.Restart != "no" { - return errors.Errorf("the --rm option conflicts with --restart") + return errors.Errorf(`the --rm option conflicts with --restart, when the restartPolicy is not "" and "no"`) } if _, err := util.ValidatePullType(c.Pull); err != nil { diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index e7b88eb3f..84ae70b6a 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -233,7 +233,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string // validate flags as needed if err := c.validate(); err != nil { - return nil + return err } s.User = c.User -- cgit v1.2.3-54-g00ecf