You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo -n "Cluster ${K8S_CLUSTER} in resource group ${K8S_RESOURCEGROUP}"
37
+
38
+
ADMIN_PARAMETER=""
39
+
40
+
if [ "X${K8S_CLUSTER:0:1}X"=="X!X" ];then
41
+
ADMIN_PARAMETER="--admin"
42
+
K8S_CLUSTER="${K8S_CLUSTER:1}"
43
+
echo" as admin"
44
+
else
45
+
echo""
46
+
fi
47
+
48
+
echo az aks get-credentials --overwrite-existing --resource-group "${K8S_RESOURCEGROUP}" --name "${K8S_CLUSTER}"${ADMIN_PARAMETER}"${K8S_SUBSCRIPTION[@]}">>~/bin/k8s-relogin
49
+
50
+
execHandle "Fetching k8s credentials for ${CLUSTER}" az aks get-credentials --resource-group "${K8S_RESOURCEGROUP}" --name "${K8S_CLUSTER}"${ADMIN_PARAMETER}"${K8S_SUBSCRIPTION[@]}"
51
+
52
+
# az aks get-credentials since kubernetes version 1.24 puts directly the kubelogin-way into kube config, hence the check here:
53
+
if [ "$(az aks show -n "${K8S_CLUSTER}" -g "${K8S_RESOURCEGROUP}""${K8S_SUBSCRIPTION[@]}"| jq -r .currentKubernetesVersion | cut -d"." -f2)"-le 23 ];then
54
+
AZ_DO_KUBELOGIN_CONVERT=true
55
+
fi
56
+
57
+
done
58
+
chmod +x ~/bin/k8s-relogin
59
+
60
+
if${AZ_DO_KUBELOGIN_CONVERT};then
61
+
args=()
62
+
if${AZ_USE_ARM_SPI:-false};
63
+
then
64
+
args+=("-l""spn")
65
+
fi
66
+
67
+
execHandle "Converting credentials to kubelogin" kubelogin convert-kubeconfig "${args[@]}"
0 commit comments