Closed badamowicz closed 2 years ago
Seems podman inspect returns with an exit code of 0 even if it fails. That's why
if podman inspect --format '{{ .VolumesRW }}' "$c" 2>/dev/null 1>&2; then
succeeds, even if there is no VolumesRW field set. This in turn will execute
volumes=$(podman inspect --format '{{ .VolumesRW }}' "$c")
which overrides the previously populated variable $volumes which then may lead to a false positive result.
Couldn't find any good information about podman's exit codes which maybe would have led to another solution, so I'd like to propose this one.
All cases tested with podman version 3.4.2.
Cheers Bernd
Signed-off-by: Adamowicz, Bernd info@bernd-adamowicz.de
LGTM
Seems podman inspect returns with an exit code of 0 even if it fails. That's why
succeeds, even if there is no VolumesRW field set. This in turn will execute
which overrides the previously populated variable $volumes which then may lead to a false positive result.
Couldn't find any good information about podman's exit codes which maybe would have led to another solution, so I'd like to propose this one.
All cases tested with podman version 3.4.2.
Cheers Bernd
Signed-off-by: Adamowicz, Bernd info@bernd-adamowicz.de