From 60af13ca0f7d11479ffdec3fd4831c974fefa3b7 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Sun, 1 Sep 2024 13:42:22 +0100 Subject: [PATCH] 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 --- libpod/container_inspect_freebsd.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libpod/container_inspect_freebsd.go b/libpod/container_inspect_freebsd.go index a913b7e7d7..a35b6754b0 100644 --- a/libpod/container_inspect_freebsd.go +++ b/libpod/container_inspect_freebsd.go @@ -15,5 +15,14 @@ func (c *Container) platformInspectContainerHostConfig(ctrSpec *spec.Spec, hostC // UTS namespace mode 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 }