Skip to content

Commit 6d3a18b

Browse files
committed
test images: Image Promoter sed fix
The image used by the Image Promoter (gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4) is based on busybox, and thus, the sed binary is actually busybox. image-util.sh calls kube::util::ensure-gnu-sed several times, which ensures that a GNU sed binary exists (it checks by greping GNU in its --help output). Obviously, it won't match the busybox sed binary. But the sed usage in image-util.sh is fairly simple, and the busybox sed is sufficient. This was previously fixed in: kubernetes#87188, but it was reverted by kubernetes#87653 as it was failing on Mac (sed does not exist). This commit fixes that issue as well.
1 parent ddd6d66 commit 6d3a18b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hack/lib/util.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,8 @@ function kube::util::ensure_dockerized {
700700
function kube::util::ensure-gnu-sed {
701701
# NOTE: the echo below is a workaround to ensure sed is executed before the grep.
702702
# see: https://github.com/kubernetes/kubernetes/issues/87251
703-
if LANG=C sed --help 2>&1 | grep -q "GNU\|BusyBox"; then
703+
sed_help="$(LANG=C sed --help 2>&1 || true)"
704+
if echo "${sed_help}" | grep -q "GNU\|BusyBox"; then
704705
SED="sed"
705706
elif command -v gsed &>/dev/null; then
706707
SED="gsed"

0 commit comments

Comments
 (0)