diff options
author | Doug Rabson <dfr@rabson.org> | 2022-08-31 13:07:53 +0100 |
---|---|---|
committer | Doug Rabson <dfr@rabson.org> | 2022-09-15 08:10:35 +0100 |
commit | 45d09e65b8737a8e065ba8270d55334b207b6769 (patch) | |
tree | dc0949d5f97ada434585dd1d729f37241e94b118 /libpod | |
parent | 2e4db139ac85d81406e826fad24abc68e54b65a7 (diff) | |
download | podman-45d09e65b8737a8e065ba8270d55334b207b6769.tar.gz podman-45d09e65b8737a8e065ba8270d55334b207b6769.tar.bz2 podman-45d09e65b8737a8e065ba8270d55334b207b6769.zip |
libpod: Make getContainerInspectData work on FreeBSD
This makes setting EffectiveCaps and BoundingCaps conditional on whether
the capabilites field in the spec is non-nil. This allows 'podman inspect'
to work on FreeBSD.
[NO NEW TESTS NEEDED]
Signed-off-by: Doug Rabson <dfr@rabson.org>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_inspect.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index 5dc65a6be..e4089efa6 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -158,8 +158,6 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver Driver: driverData.Name, MountLabel: config.MountLabel, ProcessLabel: config.ProcessLabel, - EffectiveCaps: ctrSpec.Process.Capabilities.Effective, - BoundingCaps: ctrSpec.Process.Capabilities.Bounding, AppArmorProfile: ctrSpec.Process.ApparmorProfile, ExecIDs: execIDs, GraphDriver: driverData, @@ -168,6 +166,10 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver IsInfra: c.IsInfra(), IsService: c.IsService(), } + if ctrSpec.Process.Capabilities != nil { + data.EffectiveCaps = ctrSpec.Process.Capabilities.Effective + data.BoundingCaps = ctrSpec.Process.Capabilities.Bounding + } if c.state.ConfigPath != "" { data.OCIConfigPath = c.state.ConfigPath |