Ensure kubectl is available in PATH by explicitly exporting the script

This commit is contained in:
Davanum Srinivas 2020-02-07 08:49:38 -05:00
parent ab97b666e2
commit 2c93aa6ec3
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59

View File

@ -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=")