From 948fb5ee64e1be8ad4ec5a748059fa45e73e2fe1 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 2 Apr 2019 10:25:27 -0400 Subject: Restart policy conflicts with the --rm flag Signed-off-by: Matthew Heon --- cmd/podman/shared/create.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 1ef852cd2..d2bd23e3e 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -41,6 +41,9 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod. span, _ := opentracing.StartSpanFromContext(ctx, "createContainer") defer span.Finish() } + if c.Bool("rm") && c.String("restart") != "" && c.String("restart") != "no" { + return nil, nil, errors.Errorf("the --rm flag conflicts with --restart") + } rtc, err := runtime.GetConfig() if err != nil { -- cgit v1.2.3-54-g00ecf