From 8f868a446f8dbfdbc1cc691657aa9959afb61032 Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Tue, 16 Jun 2026 16:06:15 +0530 Subject: [PATCH 1/8] calico-vpp-agent: add clean targets Add clean, clean-image, and clean-all targets to remove locally generated agent binaries, version metadata, and Docker image tags produced by the image build. --- calico-vpp-agent/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/calico-vpp-agent/Makefile b/calico-vpp-agent/Makefile index a81c5cd21..48bbf4a32 100644 --- a/calico-vpp-agent/Makefile +++ b/calico-vpp-agent/Makefile @@ -44,6 +44,24 @@ push: ${PUSH_DEP} .PHONY: dev dev: image +.PHONY: clean +clean: + rm -rf bin/ + rm -f $(VERSION_FILE) + +.PHONY: clean-image +# TAG must be specified explicitly, e.g.: make clean-image TAG= +clean-image: + docker rmi calicovpp/agent:$(TAG) || true + @if [ "${ALSO_LATEST}" = "y" ]; then \ + docker rmi calicovpp/agent:latest || true; \ + docker rmi calicovpp/agent:prerelease || true; \ + fi + +.PHONY: clean-all +# TAG must be specified explicitly, e.g.: make clean-all TAG= +clean-all: clean clean-image + .PHONY: proto proto: $(MAKE) -C proto $@ From 71ce6ef917618e5d94d974d86af827dd4075b137 Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Fri, 19 Jun 2026 16:30:10 +0530 Subject: [PATCH 2/8] make: use $(MAKE) for recursive calls This preserves make flags and jobserver propagation for nested targets. --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 5993be4ba..068c8e7bb 100644 --- a/Makefile +++ b/Makefile @@ -31,15 +31,15 @@ kind-cluster-name: .PHONY: kind-rm-cluster kind-rm-cluster: - make -C test/kind rm-cluster + $(MAKE) -C test/kind rm-cluster .PHONY: kind-new-cluster kind-new-cluster: - make -C test/kind new-cluster + $(MAKE) -C test/kind new-cluster .PHONY: kind-install-cni kind-install-cni: - make -C test/kind install-cni + $(MAKE) -C test/kind install-cni .PHONY: kind kind: kind-new-cluster image-kind kind-install-cni @@ -75,19 +75,19 @@ dev.k3s: dev .PHONY: dev-kind dev-kind: dev - make -C test/kind dev + $(MAKE) -C test/kind dev .PHONY: load-kind load-kind: - make -C test/kind load + $(MAKE) -C test/kind load .PHONY: run-prometheus run-prometheus: - make -C test/prometheus run + $(MAKE) -C test/prometheus run .PHONY: stop-prometheus stop-prometheus: - make -C test/prometheus stop + $(MAKE) -C test/prometheus stop .PHONY: install-test-deps install-test-deps: @@ -232,7 +232,7 @@ cherry-vpp: echo "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]; \ fi @BASE=$(BASE) bash ./vpplink/generated/vpp_clone_current.sh ${VPP_DIR} - @make goapi + @$(MAKE) goapi .PHONY: cherry-wipe cherry-wipe: From 210574055588b71ccdbd477f2061ba346df806b1 Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Fri, 19 Jun 2026 16:37:41 +0530 Subject: [PATCH 3/8] calicovppctl: gate latest image tag on ALSO_LATEST Only add the calicovpp/ctl:latest tag when ALSO_LATEST=y. Previously, ALSO_LATEST=n still evaluated as true because it was non-empty. --- cmd/calicovppctl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/calicovppctl/Makefile b/cmd/calicovppctl/Makefile index 8050e96ce..016579e26 100644 --- a/cmd/calicovppctl/Makefile +++ b/cmd/calicovppctl/Makefile @@ -39,6 +39,6 @@ push: ${PUSH_DEP} --platform linux/arm64,linux/amd64 \ --push \ $(foreach registry,$(REGISTRIES),-t $(registry)calicovpp/ctl:$(TAG)) \ - $(if $(ALSO_LATEST),$(foreach registry,$(REGISTRIES),-t $(registry)calicovpp/ctl:latest)) \ + $(if $(filter y,$(ALSO_LATEST)),$(foreach registry,$(REGISTRIES),-t $(registry)calicovpp/ctl:latest)) \ . docker buildx rm vppctlbuilder From 958c7f80edacd064dfbb6a39593da2e026f4a91f Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Fri, 19 Jun 2026 16:54:50 +0530 Subject: [PATCH 4/8] build: avoid docker push --all-tags Replace docker push --all-tags with explicit tag pushes. Using --all-tags makes pushes depend on local Docker state. For example, ALSO_LATEST=n can still push a stale local :latest tag left by an earlier build. It can also publish unrelated local tags for the same repository. Push only the tags created by the current target. --- calico-vpp-agent/Makefile | 6 +++++- multinet-monitor/Makefile | 6 +++++- vpp-manager/Makefile | 16 +++++++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/calico-vpp-agent/Makefile b/calico-vpp-agent/Makefile index 48bbf4a32..e4384bb3f 100644 --- a/calico-vpp-agent/Makefile +++ b/calico-vpp-agent/Makefile @@ -38,7 +38,11 @@ push: ${PUSH_DEP} docker tag calicovpp/agent:$(TAG) $${registry}calicovpp/agent:latest; \ docker tag calicovpp/agent:$(TAG) $${registry}calicovpp/agent:prerelease; \ fi; \ - docker push --all-tags $${registry}calicovpp/agent; \ + docker push $${registry}calicovpp/agent:$(TAG); \ + if [ "${ALSO_LATEST}" = "y" ]; then \ + docker push $${registry}calicovpp/agent:latest; \ + docker push $${registry}calicovpp/agent:prerelease; \ + fi; \ done .PHONY: dev diff --git a/multinet-monitor/Makefile b/multinet-monitor/Makefile index 7eca8bc9e..41207e24a 100644 --- a/multinet-monitor/Makefile +++ b/multinet-monitor/Makefile @@ -27,5 +27,9 @@ push: ${PUSH_DEP} docker tag calicovpp/multinet-monitor:latest $${registry}calicovpp/multinet-monitor:latest; \ docker tag calicovpp/multinet-monitor:prerelease $${registry}calicovpp/multinet-monitor:prerelease; \ fi; \ - docker push --all-tags $${registry}calicovpp/multinet-monitor; \ + docker push $${registry}calicovpp/multinet-monitor:$(TAG); \ + if [ "${ALSO_LATEST}" = "y" ]; then \ + docker push $${registry}calicovpp/multinet-monitor:latest; \ + docker push $${registry}calicovpp/multinet-monitor:prerelease; \ + fi; \ done diff --git a/vpp-manager/Makefile b/vpp-manager/Makefile index 24ca04c0a..7b45faa67 100644 --- a/vpp-manager/Makefile +++ b/vpp-manager/Makefile @@ -145,9 +145,19 @@ push: ${PUSH_DEP} docker tag calicovpp/vclsidecar:$(TAG) $${registry}calicovpp/vclsidecar:latest; \ docker tag calicovpp/vclsidecar:$(TAG) $${registry}calicovpp/vclsidecar:prerelease; \ fi; \ - docker push --all-tags $${registry}calicovpp/vpp; \ - docker push --all-tags $${registry}calicovpp/init-eks; \ - docker push --all-tags $${registry}calicovpp/vclsidecar; \ + docker push $${registry}calicovpp/vpp:$(TAG); \ + docker push $${registry}calicovpp/vpp:dbg-$(TAG); \ + docker push $${registry}calicovpp/init-eks:$(TAG); \ + docker push $${registry}calicovpp/vclsidecar:$(TAG); \ + docker push $${registry}calicovpp/vclsidecar:dbg-$(TAG); \ + if [ "${ALSO_LATEST}" = "y" ]; then \ + docker push $${registry}calicovpp/vpp:latest; \ + docker push $${registry}calicovpp/vpp:prerelease; \ + docker push $${registry}calicovpp/init-eks:latest; \ + docker push $${registry}calicovpp/init-eks:prerelease; \ + docker push $${registry}calicovpp/vclsidecar:latest; \ + docker push $${registry}calicovpp/vclsidecar:prerelease; \ + fi; \ done .PHONY: clean From bd1d9949da6283ef7c893f7c145c20ff227f0370 Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Fri, 19 Jun 2026 17:20:31 +0530 Subject: [PATCH 5/8] multinet-monitor: add missing .PHONY for push and fix ALSO_LATEST tagging source push was missing a .PHONY declaration, and the ALSO_LATEST docker tag commands were sourcing from :latest/:prerelease local tags rather than :$(TAG). That could fail when those moving tags do not exist locally, or publish stale tags left by an earlier build. --- multinet-monitor/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multinet-monitor/Makefile b/multinet-monitor/Makefile index 41207e24a..605334ec8 100644 --- a/multinet-monitor/Makefile +++ b/multinet-monitor/Makefile @@ -20,12 +20,13 @@ image: build .PHONY: dev dev: image +.PHONY: push push: ${PUSH_DEP} set -e; for registry in ${REGISTRIES}; do \ docker tag calicovpp/multinet-monitor:$(TAG) $${registry}calicovpp/multinet-monitor:$(TAG); \ if [ "${ALSO_LATEST}" = "y" ]; then \ - docker tag calicovpp/multinet-monitor:latest $${registry}calicovpp/multinet-monitor:latest; \ - docker tag calicovpp/multinet-monitor:prerelease $${registry}calicovpp/multinet-monitor:prerelease; \ + docker tag calicovpp/multinet-monitor:$(TAG) $${registry}calicovpp/multinet-monitor:latest; \ + docker tag calicovpp/multinet-monitor:$(TAG) $${registry}calicovpp/multinet-monitor:prerelease; \ fi; \ docker push $${registry}calicovpp/multinet-monitor:$(TAG); \ if [ "${ALSO_LATEST}" = "y" ]; then \ From 6c0206e1c5c9fde8949623284ffde15bbe66c4a3 Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Fri, 19 Jun 2026 17:36:01 +0530 Subject: [PATCH 6/8] yaml: avoid sed -i for generated manifests Replace sed -i with a temporary file and mv so manifest generation works with both GNU sed and BSD/macOS sed. --- yaml/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yaml/Makefile b/yaml/Makefile index 2c8d701f4..2619dc1f3 100644 --- a/yaml/Makefile +++ b/yaml/Makefile @@ -30,7 +30,10 @@ build: clean kubectl kustomize overlays/test-vagrant-srv6-mounts > /dev/null kubectl kustomize overlays/test-vagrant-v6 > /dev/null kubectl kustomize overlays/test-vagrant-v6-mounts > /dev/null - @sed -i "s|:latest|:$(TAG)|g" generated/*.yaml + @for file in generated/*.yaml; do \ + sed "s|:latest|:$(TAG)|g" "$$file" > "$$file.tmp"; \ + mv "$$file.tmp" "$$file"; \ + done .PHONY: clean clean: From 6f34d47f35b0eade796582d2e4f264f8a2085a4f Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Fri, 19 Jun 2026 17:43:34 +0530 Subject: [PATCH 7/8] prometheus: make helper targets idempotent Name the Prometheus container and remove that exact container before run and during stop. The previous stop target matched any docker ps line containing "prometheus", which could stop unrelated containers, and failed when no match existed. Remove prometheus.yml with rm -f so repeated stop calls succeed. --- test/prometheus/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/prometheus/Makefile b/test/prometheus/Makefile index e73ab77a0..6408cce44 100644 --- a/test/prometheus/Makefile +++ b/test/prometheus/Makefile @@ -6,8 +6,9 @@ run: static_configs:\n\ - targets:" > prometheus.yml for address in $$(kubectl get node -owide | grep -v NAME | awk '{print $$6}') ; do echo " - $$address:8888" >> prometheus.yml ; done - docker run --network host -p 9090:9090 -v $$PWD/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus & + docker rm -f calicovpp-prometheus || true + docker run --name calicovpp-prometheus --network host -p 9090:9090 -v $$PWD/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus & .PHONY: stop stop: - docker stop $$(docker ps | grep prometheus | awk '{print $$1}') - rm prometheus.yml + docker rm -f calicovpp-prometheus || true + rm -f prometheus.yml From 394d77269ff3074d1c8cbbee5a303bfb9b96dcf8 Mon Sep 17 00:00:00 2001 From: Onong Tayeng Date: Fri, 26 Jun 2026 16:48:43 +0530 Subject: [PATCH 8/8] test: make iperf3-vcl cert request non-interactive Pass a fixed subject to openssl req so the Make target does not prompt for certificate fields (country, state, locality, organization, organizational unit, common name, email, challenge password, and optional company name) in non-interactive runs. --- test/yaml/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/test/yaml/Makefile b/test/yaml/Makefile index 91ac48351..1ab81a252 100644 --- a/test/yaml/Makefile +++ b/test/yaml/Makefile @@ -24,6 +24,7 @@ iperf3-vcl-image: rm -f ./iperf3-vcl/*.so.* openssl genrsa -out ./iperf3-vcl/iperfcert.key openssl req -new -key ./iperf3-vcl/iperfcert.key \ + -subj /CN=iperf3-vcl \ -out ./iperf3-vcl/iperfcert.csr openssl x509 -req -days 365 \ -in ./iperf3-vcl/iperfcert.csr \