Skip to content

Commit 6c99a1d

Browse files
authored
chore: detect gnu-sed (#5092)
Signed-off-by: zirain <[email protected]>
1 parent 42ae06d commit 6c99a1d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/make/kube.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ endif
4747

4848
##@ Kubernetes Development
4949

50+
GNU_SED := $(shell sed --version >/dev/null 2>&1 && echo "yes" || echo "no")
51+
5052
YEAR := $(shell date +%Y)
5153
CONTROLLERGEN_OBJECT_FLAGS := object:headerFile="$(ROOT_DIR)/tools/boilerplate/boilerplate.generatego.txt",year=$(YEAR)
5254

5355
.PHONY: prepare-ip-family
5456
prepare-ip-family:
55-
@find ./test -type f -name "*.yaml" | xargs sed -i -e 's/ipFamily: IPv4/ipFamily: $(ENVOY_PROXY_IP_FAMILY)/g'
57+
ifeq ($(GNU_SED),yes)
58+
@find ./test -type f -name "*.yaml" | xargs sed -i'' 's/ipFamily: IPv4/ipFamily: $(ENVOY_PROXY_IP_FAMILY)/g'
59+
else
60+
@find ./test -type f -name "*.yaml" | xargs sed -i '' 's/ipFamily: IPv4/ipFamily: $(ENVOY_PROXY_IP_FAMILY)/g'
61+
endif
5662

5763
.PHONY: manifests
5864
manifests: $(tools/controller-gen) generate-gwapi-manifests ## Generate WebhookConfiguration and CustomResourceDefinition objects.

0 commit comments

Comments
 (0)