wangyang0918 commented on a change in pull request #11619: [FLINK-16921][e2e] 
Make Kubernetes e2e test stable
URL: https://github.com/apache/flink/pull/11619#discussion_r402715315
 
 

 ##########
 File path: flink-end-to-end-tests/test-scripts/common_kubernetes.sh
 ##########
 @@ -88,22 +86,43 @@ function start_kubernetes_if_not_running {
 }
 
 function start_kubernetes {
-    [[ "${OS_TYPE}" = "linux" ]] && setup_kubernetes_for_linux
-    if ! retry_times ${MINIKUBE_START_RETRIES} ${MINIKUBE_START_BACKOFF} 
start_kubernetes_if_not_running; then
-        echo "Could not start minikube. Aborting..."
-        exit 1
+    if [[ "${OS_TYPE}" != "linux" ]]; then
+        if ! check_kubernetes_status; then
+            echo "$NON_LINUX_ENV_NOTE"
+            exit 1
+        fi
+    else
+        setup_kubernetes_for_linux
+        if ! retry_times ${MINIKUBE_START_RETRIES} ${MINIKUBE_START_BACKOFF} 
start_kubernetes_if_not_running; then
+            echo "Could not start minikube. Aborting..."
+            exit 1
+        fi
     fi
     eval $(minikube docker-env)
 }
 
 function stop_kubernetes {
-    echo "Stopping minikube ..."
-    stop_command="minikube stop"
-    [[ "${OS_TYPE}" = "linux" ]] && stop_command="sudo ${stop_command}"
-    if ! retry_times ${MINIKUBE_START_RETRIES} ${MINIKUBE_START_BACKOFF} 
"${stop_command}"; then
-        echo "Could not stop minikube. Aborting..."
-        exit 1
+    if [[ "${OS_TYPE}" != "linux" ]]; then
+        echo "$NON_LINUX_ENV_NOTE"
+    else
+        echo "Stopping minikube ..."
+        stop_command="sudo minikube stop"
+        if ! retry_times ${MINIKUBE_START_RETRIES} ${MINIKUBE_START_BACKOFF} 
"${stop_command}"; then
+            echo "Could not stop minikube. Aborting..."
+            exit 1
+        fi
     fi
 }
 
+function debug_copy_and_show_logs {
+    echo "Debugging failed Kubernetes test:"
+    echo "Currently exiting Kubernetes resources"
 
 Review comment:
   Nice catch. I will fix it.

----------------------------------------------------------------
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

Reply via email to