tillrohrmann commented on a change in pull request #10665: [FLINK-15354] Start and stop minikube only in kubernetes related e2e tests URL: https://github.com/apache/flink/pull/10665#discussion_r365354460
########## File path: flink-end-to-end-tests/test-scripts/common_kubernetes.sh ########## @@ -26,26 +26,56 @@ MINIKUBE_START_RETRIES=3 MINIKUBE_START_BACKOFF=5 RESULT_HASH="e682ec6622b5e83f2eb614617d5ab2cf" +# If running tests on non-linux os, the kubectl and minikube should be installed manually +function setup_kubernetes_for_linux { + # Download kubectl, which is a requirement for using minikube. + if ! [ -x "$(command -v kubectl)" ]; then + local version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) + curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$version/bin/linux/amd64/kubectl && \ + chmod +x kubectl && sudo mv kubectl /usr/local/bin/ + fi + # Download minikube. + if ! [ -x "$(command -v minikube)" ]; then + curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \ + chmod +x minikube && sudo mv minikube /usr/local/bin/ + fi +} + function check_kubernetes_status { minikube status return $? } function start_kubernetes_if_not_running { if ! check_kubernetes_status; then - minikube start + start_command="minikube start" + # We need sudo permission to set vm-driver to none in linux os. + [[ "${OS_TYPE}" = "linux" ]] && start_command="sudo ${start_command} --vm-driver=none" Review comment: Can we always assume that we have sudo rights? If not, then it might be simpler to require that `minikube` and `kubectl` are installed. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services