mirror of https://github.com/k3s-io/k3s
Merge pull request #53985 from sttts/sttts-mac-fixes
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix build scripts on Macpull/6/head
commit
8b1bdd8e8e
|
@ -330,7 +330,7 @@ function kube::build::has_docker() {
|
|||
}
|
||||
|
||||
function kube::build::has_ip() {
|
||||
ip -Version | grep 'iproute2' &> /dev/null
|
||||
which ip &> /dev/null && ip -Version | grep 'iproute2' &> /dev/null
|
||||
}
|
||||
|
||||
# Detect if a specific image exists
|
||||
|
|
|
@ -20,6 +20,15 @@ set -o pipefail
|
|||
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
if LANG=C sed --help 2>&1 | grep -q GNU; then
|
||||
SED="sed"
|
||||
elif which gsed &>/dev/null; then
|
||||
SED="gsed"
|
||||
else
|
||||
echo "Failed to find GNU sed as sed or gsed. If you are on Mac: brew install gnu-sed." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove generated files prior to running kazel.
|
||||
# TODO(spxtr): Remove this line once Bazel is the only way to build.
|
||||
rm -f "${KUBE_ROOT}/pkg/generated/openapi/zz_generated.openapi.go"
|
||||
|
@ -44,6 +53,6 @@ gazelle fix \
|
|||
# gazelle won't follow the symlinks in vendor/, so we can't just exclude
|
||||
# staging/. Instead we just fix the bad paths with sed.
|
||||
find staging -name BUILD -o -name BUILD.bazel | \
|
||||
xargs sed -i 's|\(importpath = "\)k8s.io/kubernetes/staging/src/\(.*\)|\1\2|'
|
||||
xargs ${SED} -i 's|\(importpath = "\)k8s.io/kubernetes/staging/src/\(.*\)|\1\2|'
|
||||
|
||||
kazel
|
||||
|
|
Loading…
Reference in New Issue