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: diff --git a/calico-vpp-agent/Makefile b/calico-vpp-agent/Makefile index a81c5cd21..e4384bb3f 100644 --- a/calico-vpp-agent/Makefile +++ b/calico-vpp-agent/Makefile @@ -38,12 +38,34 @@ 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 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 $@ 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 diff --git a/multinet-monitor/Makefile b/multinet-monitor/Makefile index 7eca8bc9e..605334ec8 100644 --- a/multinet-monitor/Makefile +++ b/multinet-monitor/Makefile @@ -20,12 +20,17 @@ 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 \ + docker push $${registry}calicovpp/multinet-monitor:latest; \ + docker push $${registry}calicovpp/multinet-monitor:prerelease; \ fi; \ - docker push --all-tags $${registry}calicovpp/multinet-monitor; \ done 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 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 \ 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 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: