Skip to content

Commit ac1b088

Browse files
committed
chore: adding check for kubelogin to resolve #164
1 parent 945b542 commit ac1b088

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

azd-hooks/predeploy.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env pwsh
22

3-
az aks get-credentials --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_AKS_CLUSTER_NAME} --overwrite-existing
3+
##########################################################
4+
# Check kubelogin and install if not exists
5+
##########################################################
6+
if (-not (Get-Command kubelogin -ErrorAction SilentlyContinue)) {
7+
az aks install-cli
8+
}
49

510
###########################################################
611
# Create the custom-values.yaml file

azd-hooks/predeploy.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22

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

511
##########################################################
612
# Create the custom-values.yaml file

0 commit comments

Comments
 (0)