Unverified Commit 3079c1df authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #65389 from Random-Liu/add-crictl-into-sudoer-path

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add /home/kubernetes/bin into sudoers path, so that `sudo crictl` works. Add `/home/kubernetes/bin` to sudoers path, so that user can call `sudo crictl` directly. Without this fix, user has to either use the full path `sudo /home/kubernetes/bin/crictl` or switch to root, which is not a good user experience. /cc @yujuhong @feiskyer @filbranden @kubernetes/sig-node-pr-reviews @kubernetes/sig-gcp-pr-reviews **Release note**: ```release-note User can now use `sudo crictl` on GCE cluster. ```
parents 53cc12b9 2af99747
...@@ -2578,6 +2578,16 @@ EOF ...@@ -2578,6 +2578,16 @@ EOF
function override-kubectl { function override-kubectl {
echo "overriding kubectl" echo "overriding kubectl"
echo "export PATH=${KUBE_HOME}/bin:\$PATH" > /etc/profile.d/kube_env.sh echo "export PATH=${KUBE_HOME}/bin:\$PATH" > /etc/profile.d/kube_env.sh
# Add ${KUBE_HOME}/bin into sudoer secure path.
local sudo_path
sudo_path=$(sudo env | grep "^PATH=")
if [[ -n "${sudo_path}" ]]; then
sudo_path=${sudo_path#PATH=}
(
umask 027
echo "Defaults secure_path=\"${KUBE_HOME}/bin:${sudo_path}\"" > /etc/sudoers.d/kube_secure_path
)
fi
} }
function override-pv-recycler { function override-pv-recycler {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment