libpod: fix HostConfig.Devices output from 'podman inspect' on FreeBSD

This changes the value emitted for HostConfig.Devices from 'null' to
'[]'. The 'null' value was preventing ansible's podman module from
working correctly on FreeBSD.

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson 2024-09-01 13:42:22 +01:00
parent b98612227c
commit 60af13ca0f

View file

@ -15,5 +15,14 @@ func (c *Container) platformInspectContainerHostConfig(ctrSpec *spec.Spec, hostC
// UTS namespace mode // UTS namespace mode
hostConfig.UTSMode = c.NamespaceMode(spec.UTSNamespace, ctrSpec) hostConfig.UTSMode = c.NamespaceMode(spec.UTSNamespace, ctrSpec)
// Devices
// Do not include if privileged - assumed that all devices will be
// included.
var err error
hostConfig.Devices, err = c.GetDevices(hostConfig.Privileged, *ctrSpec, map[string]string{})
if err != nil {
return err
}
return nil return nil
} }