diff --git a/GNUmakefile b/GNUmakefile index ec6704d1c65..64d95c44b4c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -204,7 +204,11 @@ check: ## Lint the source code @echo "==> Check proto files are in-sync..." @$(MAKE) proto - @if (git status | grep -q .pb.go); then echo the following proto files are out of sync; git status |grep .pb.go; exit 1; fi + @if (git status -s | grep -q .pb.go); then echo the following proto files are out of sync; git status -s | grep .pb.go; exit 1; fi + + @echo "==> Check format of jobspecs and HCL files..." + @$(MAKE) hclfmt + @if (git status -s | grep -q -e '\.hcl$$' -e '\.nomad$$'); then echo the following HCL files are out of sync; git status -s | grep -e '\.hcl$$' -e '\.nomad$$'; exit 1; fi @echo "==> Check API package is isolated from rest" @if go list --test -f '{{ join .Deps "\n" }}' ./api | grep github.com/hashicorp/nomad/ | grep -v -e /vendor/ -e /nomad/api/ -e nomad/api.test; then echo " /api package depends the ^^ above internal nomad packages. Remove such dependency"; exit 1; fi diff --git a/jobspec/test-fixtures/tg-scaling-policy-minimal.hcl b/jobspec/test-fixtures/tg-scaling-policy-minimal.hcl index 32d5ba71950..60aedac053f 100644 --- a/jobspec/test-fixtures/tg-scaling-policy-minimal.hcl +++ b/jobspec/test-fixtures/tg-scaling-policy-minimal.hcl @@ -1,6 +1,5 @@ job "elastic" { group "group" { - scaling { - } + scaling {} } } diff --git a/jobspec/test-fixtures/tg-scaling-policy-multi-policy.hcl b/jobspec/test-fixtures/tg-scaling-policy-multi-policy.hcl index 1ad7b0edf2b..2a70975626e 100644 --- a/jobspec/test-fixtures/tg-scaling-policy-multi-policy.hcl +++ b/jobspec/test-fixtures/tg-scaling-policy-multi-policy.hcl @@ -12,9 +12,8 @@ job "elastic" { policy { foo = "wrong" - c = false + c = false } - } } } diff --git a/jobspec/test-fixtures/tg-service-connect-local-service.hcl b/jobspec/test-fixtures/tg-service-connect-local-service.hcl index dc97689b86e..89b31d53efd 100644 --- a/jobspec/test-fixtures/tg-service-connect-local-service.hcl +++ b/jobspec/test-fixtures/tg-service-connect-local-service.hcl @@ -4,6 +4,7 @@ job "connect-proxy-local-service" { group "group" { service { name = "example" + connect { sidecar_service { proxy { @@ -14,4 +15,4 @@ job "connect-proxy-local-service" { } } } -} \ No newline at end of file +} diff --git a/jobspec/test-fixtures/tg-service-connect-proxy.hcl b/jobspec/test-fixtures/tg-service-connect-proxy.hcl index 841742c920a..f36b2d26a02 100644 --- a/jobspec/test-fixtures/tg-service-connect-proxy.hcl +++ b/jobspec/test-fixtures/tg-service-connect-proxy.hcl @@ -4,19 +4,23 @@ job "service-connect-proxy" { group "group" { service { name = "example" + connect { sidecar_service { proxy { local_service_port = 8080 local_service_address = "10.0.1.2" + upstreams { destination_name = "upstream1" local_bind_port = 2001 } + upstreams { destination_name = "upstream2" local_bind_port = 2002 } + expose { path { path = "/metrics" @@ -24,6 +28,7 @@ job "service-connect-proxy" { local_path_port = 9001 listener_port = "metrics" } + path { path = "/health" protocol = "http" @@ -31,6 +36,7 @@ job "service-connect-proxy" { listener_port = "health" } } + config { foo = "bar" } @@ -39,4 +45,4 @@ job "service-connect-proxy" { } } } -} \ No newline at end of file +} diff --git a/jobspec/test-fixtures/tg-service-connect-sidecar_task-name.hcl b/jobspec/test-fixtures/tg-service-connect-sidecar_task-name.hcl index e46d8ce3d5f..99332cef819 100644 --- a/jobspec/test-fixtures/tg-service-connect-sidecar_task-name.hcl +++ b/jobspec/test-fixtures/tg-service-connect-sidecar_task-name.hcl @@ -4,12 +4,14 @@ job "sidecar_task_name" { group "group" { service { name = "example" + connect { - sidecar_service {} + sidecar_service = {} + sidecar_task { name = "my-sidecar" } } } } -} \ No newline at end of file +}