diff --git a/Makefile b/Makefile index 0f04e445..29941c11 100644 --- a/Makefile +++ b/Makefile @@ -71,18 +71,16 @@ lint: multiarch-builder ## Lint code clean: ## remove built binaries and packages @sh -c "rm -rf bin dist" +.PHONY: unit-tests unit-tests: pids=""; \ err=0; \ - go test -trimpath -race -v $(shell go list ./client/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./cmd/engine/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./cmd/pass/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./engine/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./injector/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./pass/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./plugin/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./plugins/credentialhelper/...) & pids="$$pids $$!"; \ - go test -trimpath -race -v $(shell go list ./x/...) & pids="$$pids $$!"; \ + for dir in $(shell go list -f '{{.Dir}}' -m); do \ + case "$$dir" in \ + */store) continue ;; \ + esac; \ + go test -trimpath -race -v $$(go list "$$dir/...") & pids="$$pids $$!"; \ + done; \ for p in $$pids; do \ wait $$p || err=$$?; \ done; \ @@ -184,4 +182,4 @@ help: ## Show this help @echo Please specify a build target. The choices are: @grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(INFO_COLOR)%-30s$(NO_COLOR) %s\n", $$1, $$2}' -.PHONY: run bin format lint proto-lint proto-generate unit-tests clean help keychain-linux-unit-tests keychain-unit-tests pass pass-cross engine engine-cross +.PHONY: run bin format lint proto-lint proto-generate clean help keychain-linux-unit-tests keychain-unit-tests pass pass-cross engine engine-cross diff --git a/cmd/engine/go.mod b/cmd/engine/go.mod index de08c7fe..926e1da9 100644 --- a/cmd/engine/go.mod +++ b/cmd/engine/go.mod @@ -7,7 +7,7 @@ go 1.25.0 // retrieved using `go get`. replace github.com/docker/secrets-engine/engine => ../../engine -replace github.com/docker/secrets-engine/pass => ../../pass +replace github.com/docker/secrets-engine/pass => ./../../plugins/pass replace github.com/docker/secrets-engine/plugins/credentialhelper => ../../plugins/credentialhelper/ diff --git a/cmd/pass/go.mod b/cmd/pass/go.mod index 14559202..023c06bf 100644 --- a/cmd/pass/go.mod +++ b/cmd/pass/go.mod @@ -7,7 +7,7 @@ go 1.25.0 // retrieved using `go get`. replace github.com/docker/secrets-engine/engine => ../../engine -replace github.com/docker/secrets-engine/pass => ../../pass +replace github.com/docker/secrets-engine/pass => ./../../plugins/pass replace github.com/docker/secrets-engine/store => ../../store diff --git a/go.work b/go.work index dbfe11dc..a4eee34e 100644 --- a/go.work +++ b/go.work @@ -7,9 +7,9 @@ use ( ./cmd/pass ./engine ./injector - ./pass ./plugin ./plugins/credentialhelper + ./plugins/pass ./store ./x ) diff --git a/pass/command.go b/plugins/pass/command.go similarity index 100% rename from pass/command.go rename to plugins/pass/command.go diff --git a/pass/command_test.go b/plugins/pass/command_test.go similarity index 100% rename from pass/command_test.go rename to plugins/pass/command_test.go diff --git a/pass/commands/get.go b/plugins/pass/commands/get.go similarity index 100% rename from pass/commands/get.go rename to plugins/pass/commands/get.go diff --git a/pass/commands/list.go b/plugins/pass/commands/list.go similarity index 100% rename from pass/commands/list.go rename to plugins/pass/commands/list.go diff --git a/pass/commands/rm.go b/plugins/pass/commands/rm.go similarity index 100% rename from pass/commands/rm.go rename to plugins/pass/commands/rm.go diff --git a/pass/commands/set.go b/plugins/pass/commands/set.go similarity index 100% rename from pass/commands/set.go rename to plugins/pass/commands/set.go diff --git a/pass/commands/version.go b/plugins/pass/commands/version.go similarity index 100% rename from pass/commands/version.go rename to plugins/pass/commands/version.go diff --git a/pass/go.mod b/plugins/pass/go.mod similarity index 94% rename from pass/go.mod rename to plugins/pass/go.mod index 11078818..8715df0e 100644 --- a/pass/go.mod +++ b/plugins/pass/go.mod @@ -2,9 +2,9 @@ module github.com/docker/secrets-engine/pass go 1.25.0 -replace github.com/docker/secrets-engine/store => ../store +replace github.com/docker/secrets-engine/store => ./../../store -replace github.com/docker/secrets-engine/x => ../x +replace github.com/docker/secrets-engine/x => ./../../x require ( github.com/docker/secrets-engine/plugin v0.0.19 diff --git a/pass/go.sum b/plugins/pass/go.sum similarity index 100% rename from pass/go.sum rename to plugins/pass/go.sum diff --git a/pass/plugin.go b/plugins/pass/plugin.go similarity index 100% rename from pass/plugin.go rename to plugins/pass/plugin.go diff --git a/pass/plugin_test.go b/plugins/pass/plugin_test.go similarity index 100% rename from pass/plugin_test.go rename to plugins/pass/plugin_test.go diff --git a/pass/store/store.go b/plugins/pass/store/store.go similarity index 100% rename from pass/store/store.go rename to plugins/pass/store/store.go diff --git a/pass/teststore/teststore.go b/plugins/pass/teststore/teststore.go similarity index 100% rename from pass/teststore/teststore.go rename to plugins/pass/teststore/teststore.go diff --git a/vendor/modules.txt b/vendor/modules.txt index c55639c8..ba9337e3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -112,7 +112,7 @@ github.com/docker/go-units ## explicit; go 1.25 # github.com/docker/secrets-engine/engine v0.0.28 => ./engine ## explicit; go 1.25.0 -# github.com/docker/secrets-engine/pass v0.0.15 => ./pass +# github.com/docker/secrets-engine/pass v0.0.15 => ./plugins/pass ## explicit; go 1.25.0 # github.com/docker/secrets-engine/plugin v0.0.19 => ./plugin ## explicit; go 1.25