summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/shared/create.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index fc55e6f17..5f7263cb6 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -357,10 +357,8 @@ func ParseCreateOpts(ctx context.Context, c *cliconfig.PodmanCommand, runtime *l
return nil, errors.Errorf("--cpu-quota and --cpus cannot be set together")
}
- if c.Flag("no-hosts").Changed && c.Flag("add-host").Changed {
- if c.Bool("no-hosts") {
- return nil, errors.Errorf("--no-hosts and --add-host cannot be set together")
- }
+ if c.Bool("no-hosts") && c.Flag("add-host").Changed {
+ return nil, errors.Errorf("--no-hosts and --add-host cannot be set together")
}
// EXPOSED PORTS