Skip to content

Commit 7356e0f

Browse files
dploegerDennis Ploeger
authored andcommitted
feat: Apparently, Microsoft now wants us to use convert-kubeconfig every time
closes #169
1 parent ef132b6 commit 7356e0f

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

feature/kubernetes/install-azure.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,15 @@ EOF
4949

5050
execHandle "Fetching k8s credentials for ${CLUSTER}" az aks get-credentials --resource-group "${K8S_RESOURCEGROUP}" --name "${K8S_CLUSTER}" ${ADMIN_PARAMETER} "${K8S_SUBSCRIPTION[@]}"
5151

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-
5752
done
5853
chmod +x ~/bin/k8s-relogin
5954

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[@]}"
68-
echo kubelogin convert-kubeconfig "${args[@]}" >> ~/bin/k8s-relogin
55+
args=()
56+
if ${AZ_USE_ARM_SPI:-false};
57+
then
58+
args+=("-l" "spn")
6959
fi
60+
61+
execHandle "Converting credentials to kubelogin" kubelogin convert-kubeconfig "${args[@]}"
62+
echo kubelogin convert-kubeconfig "${args[@]}" >> ~/bin/k8s-relogin
7063
}

0 commit comments

Comments
 (0)