Skip to content

Commit

Permalink
calculate-cache.sh: shfmt -s
Browse files Browse the repository at this point in the history
Signed-off-by: Norio Nomura <[email protected]>
  • Loading branch information
norio-nomura committed Aug 5, 2024
1 parent 0cb71c8 commit 0c0c914
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hack/calculate-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0c0c914

Please sign in to comment.