diff --git a/justfile b/justfile index 3e049b60d9..71be8243d4 100644 --- a/justfile +++ b/justfile @@ -189,8 +189,8 @@ docker *args='--output=type=docker': && _clean-cache --build-arg PROFILE='{{ profile }}' \ --build-arg LINKERD2_PROXY_VENDOR='{{ LINKERD2_PROXY_VENDOR }}' \ --build-arg LINKERD2_PROXY_VERSION='{{ LINKERD2_PROXY_VERSION }}' \ + --build-arg LINKERD2_IMAGE='ghcr.io/linkerd/proxy:{{ linkerd-tag }}' \ --no-cache-filter=runtime \ - {{ if linkerd-tag == '' { '' } else { '--build-arg=RUNTIME_IMAGE=ghcr.io/linkerd/proxy:' + linkerd-tag } }} \ {{ if features != "" { "--build-arg PROXY_FEATURES=" + features } else { "" } }} \ {{ if DOCKER_BUILDX_CACHE_DIR == '' { '' } else { '--cache-from=type=local,src=' + DOCKER_BUILDX_CACHE_DIR + ' --cache-to=type=local,dest=' + DOCKER_BUILDX_CACHE_DIR } }} \ {{ args }} @@ -241,7 +241,21 @@ action-dev-check: ## Linkerd ## -linkerd-tag := env_var_or_default('LINKERD_TAG', '') +linkerd-tag := if env_var_or_default('LINKERD_TAG', '') != '' { + env('LINKERD_TAG') + } else { + ``` + tag=$(curl -sL https://api.github.com/repos/linkerd/linkerd2/releases 2>/dev/null \ + | jq -r '[.[] | select(.tag_name | startswith("edge-")) | .tag_name] | first') + if [ -z "$tag" ] || [ "$tag" = "null" ]; then + echo "ERROR: Failed to fetch latest edge tag from GitHub API." >&2 + echo " Set LINKERD_TAG environment variable to specify a tag manually." >&2 + exit 1 + fi + echo "$tag" + ``` +} + _controller-image := 'ghcr.io/linkerd/controller' _policy-image := 'ghcr.io/linkerd/controller' _init-image := 'ghcr.io/linkerd/proxy'