Skip to content

Commit

Permalink
Fix inspect to display multiple label: changes
Browse files Browse the repository at this point in the history
If the user runs a container like

podman run --security-opt seccomp=unconfined --security-opt label=type:spc_t --security-opt label=level:s0 ...

Podman inspect was only showing the second option

This change will show

            "SecurityOpt": [
                "label=type:spc_t,label=level:s0:c60",
                "seccomp=unconfined"
            ],

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jun 24, 2020
1 parent 6bc5dcc commit 7330647
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/podman/common/specgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
case "label":
// TODO selinux opts and label opts are the same thing
s.ContainerSecurityConfig.SelinuxOpts = append(s.ContainerSecurityConfig.SelinuxOpts, con[1])
s.Annotations[define.InspectAnnotationLabel] = con[1]
s.Annotations[define.InspectAnnotationLabel] = strings.Join(s.ContainerSecurityConfig.SelinuxOpts, ",label=")
case "apparmor":
s.ContainerSecurityConfig.ApparmorProfile = con[1]
s.Annotations[define.InspectAnnotationApparmor] = con[1]
Expand Down

0 comments on commit 7330647

Please sign in to comment.