From ca5550afbe80721283f4cc2b7b1968240836d495 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Fri, 22 Apr 2022 22:22:43 +1000 Subject: [PATCH] Change location of mounted kubeconfig file when it is being injected into workshop session. --- .../opt/eduk8s/etc/setup.d/01-kubernetes.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/workshop-images/base-environment/opt/eduk8s/etc/setup.d/01-kubernetes.sh b/workshop-images/base-environment/opt/eduk8s/etc/setup.d/01-kubernetes.sh index 311f3060..03cb6466 100755 --- a/workshop-images/base-environment/opt/eduk8s/etc/setup.d/01-kubernetes.sh +++ b/workshop-images/base-environment/opt/eduk8s/etc/setup.d/01-kubernetes.sh @@ -16,12 +16,13 @@ NAMESPACE_FILE="/var/run/secrets/kubernetes.io/serviceaccount/namespace" # cluster, and a kubeconfig has been provided we need to use that. We can't # count on the directory where the kubeconfig is located being writable so copy # it to $HOME/.kube/config. Only do this though if there isn't already an -# existing kubeconfig file. +# existing kubeconfig file. It is expected the kubeconfig file is mounted at +# the location /opt/kubeconfig/config. -if [ -f /opt/eduk8s/config/kubeconfig.yaml ]; then +if [ -f /opt/kubeconfig/config ]; then if [ ! -f $HOME/.kube/config ]; then mkdir -p $HOME/.kube - cp /opt/eduk8s/config/kubeconfig.yaml $HOME/.kube/config + cp /opt/kubeconfig/config $HOME/.kube/config fi fi