summaryrefslogtreecommitdiff
path: root/cmd/podman/create.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-05-24 15:37:42 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-05-24 15:37:42 +0200
commit1910118de988c8698a2d6a6eaf666dc958e454fe (patch)
tree43ed537711d7bfc007edd277d51086770d54071d /cmd/podman/create.go
parentbcbf5c48940e543b39385bc1e137ca7b5d5ad9dd (diff)
downloadpodman-1910118de988c8698a2d6a6eaf666dc958e454fe.tar.gz
podman-1910118de988c8698a2d6a6eaf666dc958e454fe.tar.bz2
podman-1910118de988c8698a2d6a6eaf666dc958e454fe.zip
warn when --security-opt and --privileged
Log a warning when --security-opt and --privileged are used together to indicate that it has no effect since --privileged will set everything. To avoid regressions, only warn, do not error out and do not print on error level. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/create.go')
-rw-r--r--cmd/podman/create.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index cb3ba14c5..2351f5860 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -7,6 +7,7 @@ import (
"github.com/containers/libpod/pkg/adapter"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
@@ -72,6 +73,10 @@ func createInit(c *cliconfig.PodmanCommand) error {
defer span.Finish()
}
+ if c.IsSet("privileged") && c.IsSet("security-opt") {
+ logrus.Warn("setting security options with --privileged has no effect")
+ }
+
// Docker-compatibility: the "-h" flag for run/create is reserved for
// the hostname (see https://github.com/containers/libpod/issues/1367).