Skip to content

Commit a433bde

Browse files
authored
Merge pull request #14567 from spowelljr/fixM1Cron
CI: Fix cron pathing on M1
2 parents 5536249 + 504825a commit a433bde

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

hack/jenkins/cron/cleanup_and_reboot_Darwin.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# Copyright 2019 The Kubernetes Authors All rights reserved.
44
#
@@ -18,15 +18,18 @@
1818
set -uf -o pipefail
1919

2020
PATH=/usr/local/bin:/sbin:/usr/local/sbin:$PATH
21+
if [ "$(uname -p)" = "arm" ]; then
22+
PATH=$PATH:/opt/homebrew/bin
23+
fi
2124

2225
# cleanup shared between Linux and macOS
2326
function check_jenkins() {
2427
jenkins_pid="$(pidof java)"
25-
if [[ "${jenkins_pid}" = "" ]]; then
28+
if [ "${jenkins_pid}" = "" ]; then
2629
return
2730
fi
2831
pstree "${jenkins_pid}" \
29-
| egrep -i 'bash|integration|e2e|minikube' \
32+
| grep -E -i 'bash|integration|e2e|minikube' \
3033
&& echo "tests are is running on pid ${jenkins_pid} ..." \
3134
&& exit 1
3235
}
@@ -42,7 +45,7 @@ logger "cleanup_and_reboot is happening!"
4245
killall java
4346

4447
# clean docker left overs
45-
docker rm -f -v $(docker ps -aq) >/dev/null 2>&1 || true
48+
docker rm -f -v "$(docker ps -aq)" >/dev/null 2>&1 || true
4649
docker volume prune -f || true
4750
docker volume ls || true
4851
docker system df || true

0 commit comments

Comments
 (0)