jobspec2: isolate package from Nomad core and BUSL. (#25021)

This commit is contained in:
James Rasell
2025-02-06 09:42:34 +01:00
committed by GitHub
parent 9fef959daf
commit b394a76b89
6 changed files with 65 additions and 59 deletions

View File

@@ -182,6 +182,14 @@ check: ## Lint the source code
@echo "==> Check API package is isolated from rest..."
@cd ./api && if go list --test -f '{{ join .Deps "\n" }}' . | grep github.com/hashicorp/nomad/ | grep -v -e /nomad/api/ -e nomad/api.test; then echo " /api package depends the ^^ above internal nomad packages. Remove such dependency"; exit 1; fi
@echo "==> Check jobspec2 package is isolated from Nomad core..."
@cd ./jobspec2 && \
if go list --test -f '{{ join .Deps "\n" }}' . | \
grep github.com/hashicorp/nomad/ | \
grep -v -e /nomad/jobspec2/ -e nomad/jobspec2.test | \
grep -v -e /nomad/api ; then echo \
" /jobspec2 package depends the ^^ above internal nomad packages. Remove such dependency"; exit 1; fi
@echo "==> Check command package does not import structs..."
@cd ./command && if go list -f '{{ join .Imports "\n" }}' . | grep github.com/hashicorp/nomad/nomad/structs; then echo " /command package imports the structs pkg. Remove such import"; exit 1; fi