Skip to content

Commit

Permalink
chore: adding check for kubelogin to resolve #164
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldotyu committed Jul 30, 2024
1 parent 945b542 commit ac1b088
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion azd-hooks/predeploy.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env pwsh

az aks get-credentials --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_AKS_CLUSTER_NAME} --overwrite-existing
##########################################################
# Check kubelogin and install if not exists
##########################################################
if (-not (Get-Command kubelogin -ErrorAction SilentlyContinue)) {
az aks install-cli
}

###########################################################
# Create the custom-values.yaml file
Expand Down
8 changes: 7 additions & 1 deletion azd-hooks/predeploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash

az aks get-credentials --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_AKS_CLUSTER_NAME} --overwrite-existing
##########################################################
# Check kubelogin and install if not exists
##########################################################
if ! command -v kubelogin &> /dev/null; then
echo "kubelogin could not be found. Installing kubelogin..."
az aks install-cli
fi

##########################################################
# Create the custom-values.yaml file
Expand Down

0 comments on commit ac1b088

Please sign in to comment.