Make comment explain why we need sudo

Also make the check more correct and quieter.
This commit is contained in:
Jeff Grafton 2016-05-02 15:00:28 -07:00
parent 0f041382ee
commit 83ac3ea0c9

View File

@ -36,10 +36,12 @@ for APIROOT in ${APIROOTS}; do
cp -a "${KUBE_ROOT}/${APIROOT}" "${_tmp}/${APIROOT}"
done
# We would like to use "sudo" when running on Travis and
# not use "sudo" when running on Jenkins.
SUDO="sudo"
sudo -h > /dev/null || SUDO=""
# If not running as root, we need to use sudo to restore the original generated
# protobuf files.
SUDO=""
if [[ "$(id -u)" != '0' ]]; then
SUDO="sudo"
fi
"${KUBE_ROOT}/hack/update-generated-protobuf.sh"
for APIROOT in ${APIROOTS}; do