Skip to content

Commit

Permalink
remove sudo -E from none driver
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr committed Apr 28, 2023
1 parent 406e689 commit fa9388f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Expand Up @@ -547,7 +547,7 @@ jobs:
chmod a+x e2e-*
chmod a+x minikube-*
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--driver=none -test.timeout=10m -test.v -timeout-multiplier=1.5 -test.run TestFunctional -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=none -test.timeout=10m -test.v -timeout-multiplier=1.5 -test.run TestFunctional -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Expand Up @@ -667,7 +667,7 @@ jobs:
chmod a+x minikube-*
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--driver=none -test.timeout=10m -test.v -timeout-multiplier=1.5 -test.run TestFunctional -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=none -test.timeout=10m -test.v -timeout-multiplier=1.5 -test.run TestFunctional -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -367,7 +367,7 @@ integration: out/minikube$(IS_EXE) ## Trigger minikube integration test, logs to

.PHONY: integration-none-driver
integration-none-driver: e2e-linux-$(GOARCH) out/minikube-linux-$(GOARCH) ## Trigger minikube none driver test, logs to ./out/testout_COMMIT.txt
sudo -E out/e2e-linux-$(GOARCH) -testdata-dir "test/integration/testdata" -minikube-start-args="--driver=none" -test.v -test.timeout=60m -binary=out/minikube-linux-amd64 $(TEST_ARGS) 2>&1 | tee "./out/testout_$(COMMIT_SHORT).txt"
out/e2e-linux-$(GOARCH) -testdata-dir "test/integration/testdata" -minikube-start-args="--driver=none" -test.v -test.timeout=60m -binary=out/minikube-linux-amd64 $(TEST_ARGS) 2>&1 | tee "./out/testout_$(COMMIT_SHORT).txt"

.PHONY: integration-versioned
integration-versioned: out/minikube ## Trigger minikube integration testing, logs to ./out/testout_COMMIT.txt
Expand Down
27 changes: 13 additions & 14 deletions hack/jenkins/common.sh
Expand Up @@ -123,7 +123,6 @@ echo "driver: ${DRIVER}"
echo "runtime: ${CONTAINER_RUNTIME}"
echo "job: ${JOB_NAME}"
echo "test home: ${TEST_HOME}"
echo "sudo: ${SUDO_PREFIX}"
echo "kernel: $(uname -v)"
echo "uptime: $(uptime)"
# Setting KUBECONFIG prevents the version check from erroring out due to permission issues
Expand Down Expand Up @@ -293,7 +292,7 @@ function cleanup_procs() {
if [[ "${kprocs}" != "" ]]; then
echo "error: killing hung kubectl processes ..."
ps -f -p ${kprocs} || true
sudo -E kill ${kprocs} || true
sudo kill ${kprocs} || true
fi


Expand All @@ -304,9 +303,9 @@ function cleanup_procs() {
for p in $none_procs
do
echo "Kiling stale none driver: $p"
sudo -E ps -f -p $p || true
sudo -E kill $p || true
sudo -E kill -9 $p || true
sudo ps -f -p $p || true
sudo kill $p || true
sudo kill -9 $p || true
done
fi
}
Expand Down Expand Up @@ -387,7 +386,7 @@ touch "${JSON_OUT}"

gotestsum --jsonfile "${JSON_OUT}" -f standard-verbose --raw-command -- \
go tool test2json -t \
${SUDO_PREFIX}${E2E_BIN} \
${E2E_BIN} \
-minikube-start-args="--driver=${DRIVER} ${EXTRA_START_ARGS}" \
-test.timeout=${TIMEOUT} -test.v \
${EXTRA_TEST_ARGS} \
Expand Down Expand Up @@ -484,16 +483,16 @@ else
fi

echo ">> Cleaning up after ourselves ..."
timeout 3m ${SUDO_PREFIX}${MINIKUBE_BIN} tunnel --cleanup || true
timeout 5m ${SUDO_PREFIX}${MINIKUBE_BIN} delete --all --purge >/dev/null 2>/dev/null || true
timeout 3m ${MINIKUBE_BIN} tunnel --cleanup || true
timeout 5m ${MINIKUBE_BIN} delete --all --purge >/dev/null 2>/dev/null || true
cleanup_stale_routes || true

${SUDO_PREFIX} rm -Rf "${MINIKUBE_HOME}" || true
${SUDO_PREFIX} rm -f "${KUBECONFIG}" || true
${SUDO_PREFIX} rm -f "${TEST_OUT}" || true
${SUDO_PREFIX} rm -f "${JSON_OUT}" || true
${SUDO_PREFIX} rm -f "${HTML_OUT}" || true
${SUDO_PREFIX} rm -f "${SUMMARY_OUT}" || true
rm -Rf "${MINIKUBE_HOME}" || true
rm -f "${KUBECONFIG}" || true
rm -f "${TEST_OUT}" || true
rm -f "${JSON_OUT}" || true
rm -f "${HTML_OUT}" || true
rm -f "${SUMMARY_OUT}" || true

rmdir "${TEST_HOME}" || true
echo ">> ${TEST_HOME} completed at $(date)"
Expand Down
3 changes: 0 additions & 3 deletions hack/jenkins/linux_integration_tests_none.sh
Expand Up @@ -31,9 +31,6 @@ DRIVER="none"
JOB_NAME="none_Linux"
EXTRA_START_ARGS="--bootstrapper=kubeadm"

SUDO_PREFIX="sudo -E "
export KUBECONFIG="/root/.kube/config"

if ! kubeadm &>/dev/null; then
echo "WARNING: kubeadm is not installed. will try to install."
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubeadm"
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/drivers/includes/none_usage.inc
Expand Up @@ -24,7 +24,7 @@ This VM must also meet the [kubeadm requirements](https://kubernetes.io/docs/set
The none driver requires minikube to be run as root, until [#3760](https://github.com/kubernetes/minikube/issues/3760) can be addressed.
```shell
sudo -E minikube start --driver=none
minikube start --driver=none
```
To make `none` the default driver:
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/drivers/none.md
Expand Up @@ -68,7 +68,7 @@ As Kubernetes has full access to both your filesystem as well as your docker ima
* Many `minikube` commands are not supported, such as: `dashboard`, `mount`, `ssh`
* minikube with the `none` driver has a confusing permissions model, as some commands need to be run as root ("start"), and others by a regular user ("dashboard")
* CoreDNS detects resolver loop, goes into CrashLoopBackOff - [#3511](https://github.com/kubernetes/minikube/issues/3511)
* Some versions of Linux have a version of docker that is newer than what Kubernetes expects. To overwrite this, run minikube with the following parameters: `sudo -E minikube start --driver=none --kubernetes-version v1.11.8 --extra-config kubeadm.ignore-preflight-errors=SystemVerification`
* Some versions of Linux have a version of docker that is newer than what Kubernetes expects. To overwrite this, run minikube with the following parameters: `minikube start --driver=none --kubernetes-version v1.11.8 --extra-config kubeadm.ignore-preflight-errors=SystemVerification`

* [Full list of open 'none' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fnone-driver)

Expand Down

0 comments on commit fa9388f

Please sign in to comment.