diff options
author | cdoern <cdoern@redhat.com> | 2021-11-04 23:48:35 -0400 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2021-12-27 13:39:36 -0500 |
commit | 289270375a54c26b86f9e2d99aab18b427e56b88 (patch) | |
tree | ee7b7c5614e0ea07ddc4c41842602740e9c8f25c /libpod/pod_api.go | |
parent | e06631d6c22f4d5b7a62f70ccdf623379a9d5fe7 (diff) | |
download | podman-289270375a54c26b86f9e2d99aab18b427e56b88.tar.gz podman-289270375a54c26b86f9e2d99aab18b427e56b88.tar.bz2 podman-289270375a54c26b86f9e2d99aab18b427e56b88.zip |
Pod Security Option support
Added support for pod security options. These are applied to infra and passed down to the
containers as added (unless overridden).
Modified the inheritance process from infra, creating a new function Inherit() which reads the config, and marshals the compatible options into an intermediate struct `InfraInherit`
This is then unmarshaled into a container config and all of this is added to the CtrCreateOptions. Removes the need (mostly) for special additons which complicate the Container_create
code and pod creation.
resolves #12173
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'libpod/pod_api.go')
-rw-r--r-- | libpod/pod_api.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/pod_api.go b/libpod/pod_api.go index 95a82721e..526e0c28b 100644 --- a/libpod/pod_api.go +++ b/libpod/pod_api.go @@ -586,6 +586,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) { var inspectMounts []define.InspectMount var devices []define.InspectDevice var deviceLimits []define.InspectBlkioThrottleDevice + var infraSecurity []string if p.state.InfraContainerID != "" { infra, err := p.runtime.GetContainer(p.state.InfraContainerID) if err != nil { @@ -603,6 +604,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) { infraConfig.UserNS = p.UserNSMode() namedVolumes, mounts := infra.sortUserVolumes(infra.config.Spec) inspectMounts, err = infra.GetInspectMounts(namedVolumes, infra.config.ImageVolumes, mounts) + infraSecurity = infra.GetSecurityOptions() if err != nil { return nil, err } @@ -678,6 +680,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) { Devices: devices, BlkioDeviceReadBps: deviceLimits, VolumesFrom: p.VolumesFrom(), + SecurityOpts: infraSecurity, } return &inspectData, nil |