fix manage-offline-container-images.sh get image_id (#12316)

Co-authored-by: DearJay <zhongtianjieyi143@gmail.com>
This commit is contained in:
k8s-infra-cherrypick-robot
2025-06-15 07:42:58 -07:00
committed by GitHub
parent 1290466c53
commit a8f5277628

View File

@@ -148,7 +148,7 @@ function register_container_images() {
if [ "${org_image}" == "ID:" ]; then
org_image=$(echo "${load_image}" | awk '{print $4}')
fi
image_id=$(sudo ${runtime} image inspect ${org_image} | grep "\"Id\":" | awk -F: '{print $3}'| sed s/'\",'//)
image_id=$(sudo ${runtime} image inspect --format "{{.Id}}" "${org_image}")
if [ -z "${file_name}" ]; then
echo "Failed to get file_name for line ${line}"
exit 1