mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-03-18 10:44:10 +00:00
getDefaultShimForArch previously returned whatever string was set in defaultShim.<arch> without any validation. A typo, a non-existent shim, or a shim that is disabled via disableAll would all silently produce a bogus DEFAULT_SHIM_* env var, causing kata-deploy to fail at runtime. Guard the return value by checking whether the configured shim is present in the list of shims that are both enabled and support the requested architecture. If not, return empty string so the env var is simply omitted. Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>