Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion steps/cloud/azure/install-kubelogin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,37 @@ steps:

echo "Installing kubelogin if not present..."
if ! command -v kubelogin &> /dev/null; then
az aks install-cli
max_retries=3
retry_delay=30
install_success=false

for i in $(seq 1 $max_retries); do
if az aks install-cli; then
Copy link
Contributor

@vittoriasalim vittoriasalim Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is better to cache this cli installation into telescope package so it will not fail

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the binary to telescope storage account, so it will not timeout , please have a look at this PR
https://github.com/Azure/telescope/pull/1055/changes

echo "Successfully installed via az aks install-cli"
install_success=true
break
fi
if [ $i -lt $max_retries ]; then
echo "Attempt $i failed, retrying in ${retry_delay}s..."
sleep $retry_delay
retry_delay=$((retry_delay * 2))
fi
done

# Fallback to direct GitHub download if az aks install-cli failed
if [ "$install_success" = false ]; then
echo "az aks install-cli failed after $max_retries attempts, falling back to GitHub download..."

VERSION=$(curl -sL https://api.github.com/repos/Azure/kubelogin/releases/latest | jq -r '.tag_name')
echo "Downloading kubelogin $VERSION from GitHub..."

curl -LO "https://github.com/Azure/kubelogin/releases/download/${VERSION}/kubelogin-linux-amd64.zip"
unzip -o kubelogin-linux-amd64.zip
sudo mv bin/linux_amd64/kubelogin /usr/local/bin/
rm -rf kubelogin-linux-amd64.zip bin/
Comment on lines +43 to +46
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback path introduces a dependency on unzip, but this repo’s setup step only checks for jq and doesn’t install/verify unzip. If the agent image changes (or a self-hosted agent is used), this can fail at runtime. Either ensure unzip is installed/checked before use or extract the archive using a tool already guaranteed to exist in your environment.

Copilot uses AI. Check for mistakes.

echo "Successfully installed kubelogin $VERSION from GitHub"
fi
fi

echo "Converting kubeconfig for Azure CLI authentication..."
Expand Down