diff --git a/hack/calculate-cache.sh b/hack/calculate-cache.sh index d7b38fdb024..a51904ace61 100755 --- a/hack/calculate-cache.sh +++ b/hack/calculate-cache.sh @@ -73,7 +73,7 @@ function check_location() { location="$1" readonly cache_file="./.calculate-cache-response-cache.yaml" # check response_cache.yaml for the cache - if [[ -f "${cache_file}" ]]; then + if [[ -f ${cache_file} ]]; then cached=$(yq -e eval ".[\"${location}\"]" "${cache_file}" 2>/dev/null) && echo "${cached}" && return else touch "${cache_file}" @@ -161,15 +161,15 @@ for cache_method in prior after; do for template in "${tepmlates_used_in_test_yml[@]}"; do location_digest_size_hash=$(print_location_digest_size_hash_from_template "${template}") || continue read -r location digest size hash containerd containerd_location containerd_digest containerd_size <<<"${location_digest_size_hash}" - if [[ ${cache_method} = prior ]]; then + if [[ ${cache_method} == prior ]]; then key=${runner_os}-${hash} - elif [[ ${digest} = null ]]; then + elif [[ ${digest} == null ]]; then key=image:$(basename "${location}")-url-sha256:$(echo -n "${location}" | sha256sum | cut -d' ' -f1) else key=image:$(basename "${location}")-${digest} fi - if [[ ${containerd} = true ]]; then - if [[ ${cache_method} = prior ]]; then + if [[ ${containerd} == true ]]; then + if [[ ${cache_method} == prior ]]; then # previous caching method packages the containerd archive with the image size=$((size + containerd_size)) else