-
Notifications
You must be signed in to change notification settings - Fork 19
Deflake install kube login #1049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| 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..." | ||
|
|
||
vittoriasalim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| curl -LO "https://github.com/Azure/kubelogin/releases/download/${VERSION}/kubelogin-linux-amd64.zip" | ||
vittoriasalim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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
|
||
|
|
||
vittoriasalim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "Successfully installed kubelogin $VERSION from GitHub" | ||
| fi | ||
| fi | ||
|
|
||
| echo "Converting kubeconfig for Azure CLI authentication..." | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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