metrics: determine the realpath of kata-shim component.

Determine the realpath of kata-shim avoiding the check fails
in case the kata-shim is not a symlink, as was happening prior
to this commit.

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
This commit is contained in:
David Esparza 2024-05-17 14:40:02 -06:00
parent 9a6d8d8330
commit bae377b42a
No known key found for this signature in database
GPG Key ID: EABE0B1A98CC3B7A

View File

@ -149,7 +149,9 @@ function extract_kata_env() {
RUNTIME_PATH=$(sudo ${cmd} env --json | jq -r ${runtime_path}) RUNTIME_PATH=$(sudo ${cmd} env --json | jq -r ${runtime_path})
# Shimv2 path is being affected by https://github.com/kata-containers/kata-containers/issues/1151 # Shimv2 path is being affected by https://github.com/kata-containers/kata-containers/issues/1151
SHIM_PATH=$(readlink $(command -v containerd-shim-kata-v2)) SHIM_PATH=$(command -v containerd-shim-kata-v2)
[ -L ${SHIM_PATH} ] && SHIM_PATH=$(readlink ${SHIM_PATH})
SHIM_VERSION=${RUNTIME_VERSION} SHIM_VERSION=${RUNTIME_VERSION}
HYPERVISOR_PATH=$(sudo ${cmd} env --json | jq -r ${hypervisor_path}) HYPERVISOR_PATH=$(sudo ${cmd} env --json | jq -r ${hypervisor_path})