mirror of
https://github.com/containers/podman.git
synced 2025-05-21 09:05:56 +08:00
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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user