From 2c93aa6ec371bdaa930eebdbf98e0f22db3ff4ee Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 7 Feb 2020 08:49:38 -0500 Subject: [PATCH] Ensure kubectl is available in PATH by explicitly exporting the script --- cluster/gce/gci/configure-helper.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 88df3785883..d486eb1f555 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -2563,6 +2563,11 @@ EOF function override-kubectl { echo "overriding kubectl" echo "export PATH=${KUBE_HOME}/bin:\$PATH" > /etc/profile.d/kube_env.sh + + # source the file explicitly otherwise we have + # issues on a ubuntu OS image finding the kubectl + source /etc/profile.d/kube_env.sh + # Add ${KUBE_HOME}/bin into sudoer secure path. local sudo_path sudo_path=$(sudo env | grep "^PATH=")