mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Fix build on OS X when GNU sed is present.
See #20147, which fixed it when system default BSD sed was present but did not account for possibiliyt of GNU sed on OS X.
This commit is contained in:
parent
939b98481e
commit
d0e36819a4
@ -242,11 +242,15 @@ function kube::build::is_osx() {
|
||||
[[ "$(uname)" == "Darwin" ]]
|
||||
}
|
||||
|
||||
function kube::build::is_gnu_sed() {
|
||||
[[ $(sed --version 2>&1) == *GNU* ]]
|
||||
}
|
||||
|
||||
function kube::build::update_dockerfile() {
|
||||
if kube::build::is_osx; then
|
||||
sed_opts=(-i '')
|
||||
else
|
||||
if kube::build::is_gnu_sed; then
|
||||
sed_opts=(-i)
|
||||
else
|
||||
sed_opts=(-i '')
|
||||
fi
|
||||
sed "${sed_opts[@]}" "s/KUBE_BUILD_IMAGE_CROSS_TAG/${KUBE_BUILD_IMAGE_CROSS_TAG}/" "${LOCAL_OUTPUT_BUILD_CONTEXT}/Dockerfile"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user