@@ -150,7 +150,7 @@ GOTEST ?= $(GO) test
150
150
OUTPUTDIR = $(join $(ROOTDIR ) , _output)
151
151
CRIDIR =$(OUTPUTDIR ) /cri
152
152
153
- .PHONY : clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release static-release mandir install-man install-doc genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test
153
+ .PHONY : clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release static-release mandir install-man install-doc genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test remove-replace clean-vendor
154
154
.DEFAULT : default
155
155
156
156
# Forcibly set the default goal to all, in case an include above brought in a rule definition.
@@ -181,6 +181,8 @@ protos: bin/protoc-gen-go-fieldpath
181
181
@rm -rf ${TMPDIR} v2
182
182
go-fix-acronym -w -a ' ^Os' $(shell find api/ -name '* .pb.go')
183
183
go-fix-acronym -w -a ' (Id|Io|Uuid|Os)$$' $(shell find api/ -name '* .pb.go')
184
+ @test -z " $$ (git status --short | grep " api/next.pb.txt" | tee /dev/stderr)" || \
185
+ $(GO ) mod edit -replace=github.com/containerd/containerd/api=./api
184
186
185
187
check-protos : protos # # check if protobufs needs to be generated again
186
188
@echo " $( WHALE) $@ "
@@ -466,6 +468,10 @@ root-coverage: ## generate coverage profiles for unit tests that require root
466
468
fi ; \
467
469
done )
468
470
471
+ remove-replace :
472
+ @echo " $( WHALE) $@ "
473
+ @$(GO ) mod edit -dropreplace=github.com/containerd/containerd/api
474
+
469
475
vendor : # # ensure all the go.mod/go.sum files are up-to-date including vendor/ directory
470
476
@echo " $( WHALE) $@ "
471
477
@$(GO ) mod tidy
@@ -484,6 +490,8 @@ verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date
484
490
@diff -r -u -q ${ROOTDIR} ${TMPDIR} /containerd
485
491
@rm -rf ${TMPDIR}
486
492
493
+ clean-vendor : remove-replace vendor
494
+
487
495
488
496
help : # # this help
489
497
@awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST ) | sort
0 commit comments