Automator: update common-files@master in istio/istio.io@master (#15245)

This commit is contained in:
Istio Automation 2024-06-04 19:12:05 -04:00 committed by GitHub
parent 89e95a5328
commit d451a4a8d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -1 +1 @@
882f56284f6082417dace0a8fd667677e41f0841
227a3c84e7a83be4d2cbe9eb219c4de7979415e2

View File

@ -95,6 +95,19 @@ IMG="${IMG:-${TOOLS_REGISTRY_PROVIDER}/${PROJECT_ID}/${IMAGE_NAME}:${IMAGE_VERSI
CONTAINER_CLI="${CONTAINER_CLI:-docker}"
# Try to use the latest cached image we have. Use at your own risk, may have incompatibly-old versions
if [[ "${LATEST_CACHED_IMAGE:-}" != "" ]]; then
prefix="$(<<<"$IMAGE_VERSION" cut -d- -f1)"
query="${TOOLS_REGISTRY_PROVIDER}/${PROJECT_ID}/${IMAGE_NAME}:${prefix}-*"
latest="$("${CONTAINER_CLI}" images --filter=reference="${query}" --format "{{.CreatedAt|json}}~{{.Repository}}:{{.Tag}}~{{.CreatedSince}}" | sort -n -r | head -n1)"
IMG="$(<<<"$latest" cut -d~ -f2)"
if [[ "${IMG}" == "" ]]; then
echo "Attempted to use LATEST_CACHED_IMAGE, but found no images matching ${query}" >&2
exit 1
fi
echo "Using cached image $IMG, created $(<<<"$latest" cut -d~ -f3)" >&2
fi
ENV_BLOCKLIST="${ENV_BLOCKLIST:-^_\|^PATH=\|^GOPATH=\|^GOROOT=\|^SHELL=\|^EDITOR=\|^TMUX=\|^USER=\|^HOME=\|^PWD=\|^TERM=\|^RUBY_\|^GEM_\|^rvm_\|^SSH=\|^TMPDIR=\|^CC=\|^CXX=\|^MAKEFILE_LIST=}"
# Remove functions from the list of exported variables, they mess up with the `env` command.