Skip to content

Commit 7ad6bfa

Browse files
committed
[FLINK-17857][test] Make K8s e2e tests could run on Mac
1 parent 0f8adc0 commit 7ad6bfa

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

flink-end-to-end-tests/test-scripts/common_kubernetes.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ MINIKUBE_START_RETRIES=3
2525
MINIKUBE_START_BACKOFF=5
2626
RESULT_HASH="e682ec6622b5e83f2eb614617d5ab2cf"
2727
MINIKUBE_VERSION="v1.8.2"
28-
MINIKUBE_PATH="/usr/local/bin/minikube-$MINIKUBE_VERSION"
28+
MINIKUBE_PATH=$([ "${OS_TYPE}" != "linux" ] && echo "minikube" || echo "/usr/local/bin/minikube-$MINIKUBE_VERSION")
2929

3030
NON_LINUX_ENV_NOTE="****** Please start/stop minikube manually in non-linux environment. ******"
3131

@@ -97,8 +97,9 @@ function start_kubernetes {
9797
exit 1
9898
fi
9999
# Mount Flink dist into minikube virtual machine because we need to mount hostPath as usrlib
100-
minikube mount $FLINK_DIR:$FLINK_DIR &
100+
$MINIKUBE_PATH mount $FLINK_DIR:$FLINK_DIR &
101101
export minikube_mount_pid=$!
102+
echo "The mounting process is running with pid $minikube_mount_pid"
102103
else
103104
setup_kubernetes_for_linux
104105
if ! retry_times ${MINIKUBE_START_RETRIES} ${MINIKUBE_START_BACKOFF} start_kubernetes_if_not_running; then
@@ -112,6 +113,7 @@ function start_kubernetes {
112113
function stop_kubernetes {
113114
if [[ "${OS_TYPE}" != "linux" ]]; then
114115
echo "$NON_LINUX_ENV_NOTE"
116+
echo "Killing mounting process $minikube_mount_pid"
115117
kill $minikube_mount_pid 2> /dev/null
116118
else
117119
echo "Stopping minikube ..."
@@ -178,21 +180,9 @@ function cleanup {
178180
stop_kubernetes
179181
}
180182

181-
function setConsoleLogging {
182-
cat >> $FLINK_DIR/conf/log4j.properties <<END
183-
rootLogger.appenderRef.console.ref = ConsoleAppender
184-
185-
# Log all infos to the console
186-
appender.console.name = ConsoleAppender
187-
appender.console.type = CONSOLE
188-
appender.console.layout.type = PatternLayout
189-
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %-60c %x - %m%n
190-
END
191-
}
192-
193183
function get_host_machine_address {
194184
if [[ "${OS_TYPE}" != "linux" ]]; then
195-
echo $(minikube ssh "route -n | grep ^0.0.0.0 | awk '{ print \$2 }' | tr -d '[:space:]'")
185+
echo $($MINIKUBE_PATH ssh "route -n | grep ^0.0.0.0 | awk '{ print \$2 }' | tr -d '[:space:]'")
196186
else
197187
echo "localhost"
198188
fi

0 commit comments

Comments
 (0)