From 8fea3d0ab57f487c48e4f06361f7933dd239a0e0 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 13 Apr 2020 17:07:51 -0400 Subject: Need to set security options even if user does not specify options Signed-off-by: Daniel J Walsh --- cmd/podman/shared/create.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 68a36d967..94b1e63dc 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -783,10 +783,12 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. Sysctl: sysctl, } + var securityOpt []string if c.Changed("security-opt") { - if err := secConfig.SetSecurityOpts(runtime, c.StringArray("security-opt")); err != nil { - return nil, err - } + securityOpt = c.StringArray("security-opt") + } + if err := secConfig.SetSecurityOpts(runtime, securityOpt); err != nil { + return nil, err } // SECCOMP -- cgit v1.2.3-54-g00ecf