Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kind.sh development scripts on MacOS #25317

Merged
merged 1 commit into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ microk8s: check-microk8s ## Build cilium-dev docker image and import to microk8s
$(QUIET)./contrib/scripts/microk8s-import.sh $(LOCAL_OPERATOR_IMAGE)

kind: ## Create a kind cluster for Cilium development.
$(QUIET)./contrib/scripts/kind.sh
SED=$(SED) $(QUIET)./contrib/scripts/kind.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $(QUIET) part must come at the start of the line, this breaks make kind in quiet mode.


kind-down: ## Destroy a kind cluster for Cilium development.
$(QUIET)./contrib/scripts/kind-down.sh
Expand Down
2 changes: 1 addition & 1 deletion Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DOCKER_BUILD_FLAGS?=

# use gsed if avaiable, otherwise use sed.
# gsed is needed for MacOS to make in-place replacement work correctly.
SED ?= $(if $(shell command -v gsed), gsed, sed)
SED ?= $(if $(shell command -v gsed),gsed,sed)

# Set DOCKER_DEV_ACCOUNT with "cilium" by default
ifeq ($(DOCKER_DEV_ACCOUNT),)
Expand Down
4 changes: 3 additions & 1 deletion contrib/scripts/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ default_network="kind-cilium"

PROG=${0}

SED="${SED:-sed}"

xdp=false
if [ "${1:-}" = "--xdp" ]; then
xdp=true
Expand Down Expand Up @@ -169,7 +171,7 @@ fi
# Replace "forward . /etc/resolv.conf" in the coredns cm with "forward . 8.8.8.8".
# This is required because in case of BPF Host Routing we bypass iptables thus
# breaking DNS. See https://github.com/cilium/cilium/issues/23330
NewCoreFile=$(kubectl get cm -n kube-system coredns -o jsonpath='{.data.Corefile}' | sed 's,forward . /etc/resolv.conf,forward . 8.8.8.8,' | sed -z 's/\n/\\n/g')
NewCoreFile=$(kubectl get cm -n kube-system coredns -o jsonpath='{.data.Corefile}' | "${SED}" 's,forward . /etc/resolv.conf,forward . 8.8.8.8,' | "${SED}" -z 's/\n/\\n/g')
kubectl patch configmap/coredns -n kube-system --type merge -p '{"data":{"Corefile": "'"$NewCoreFile"'"}}'

set +e
Expand Down