From edf7b89408281fa8ca588432e74841cc96fd1d74 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 19 May 2022 20:54:49 -0400 Subject: [PATCH 1/2] Update service.check.task definition to match code Nomad errors out when attempting to specify a task for a service that uses consul connect but does not have script or gRPC checks. See https://github.com/hashicorp/nomad/blob/304d0cf5958065d14ab8b704055b1bb11d915876/nomad/structs/structs.go#L6643 for details. --- website/content/docs/job-specification/service.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/website/content/docs/job-specification/service.mdx b/website/content/docs/job-specification/service.mdx index 9bcb3ce78..af20fe2be 100644 --- a/website/content/docs/job-specification/service.mdx +++ b/website/content/docs/job-specification/service.mdx @@ -171,9 +171,8 @@ Connect][connect] integration. - `host` - Use the host IP and port. - `task` `(string: "")` - Specifies the name of the Nomad task associated with - this service definition. Only available on group services. Must be set if this - service definition represents a Consul Connect-native service and there is more - than one task in the task group. + this service definition. Only available on group services. May only be set for + script or gRPC checks. - `meta` ([Meta][]: nil) - Specifies a key-value map that annotates the Consul service with user-defined metadata. Only available where From 626d1a79e1c420912e9edc4166aac7c3ff667474 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 19 May 2022 21:24:58 -0400 Subject: [PATCH 2/2] docs: correct where task cannot be defined --- website/content/docs/job-specification/service.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/content/docs/job-specification/service.mdx b/website/content/docs/job-specification/service.mdx index af20fe2be..a176b49f3 100644 --- a/website/content/docs/job-specification/service.mdx +++ b/website/content/docs/job-specification/service.mdx @@ -171,8 +171,9 @@ Connect][connect] integration. - `host` - Use the host IP and port. - `task` `(string: "")` - Specifies the name of the Nomad task associated with - this service definition. Only available on group services. May only be set for - script or gRPC checks. + this service definition. Only available on group services. Must be set if this + service definition represents a Consul Connect-native service and there is more + than one task in the task group. - `meta` ([Meta][]: nil) - Specifies a key-value map that annotates the Consul service with user-defined metadata. Only available where @@ -296,7 +297,7 @@ scripts. check. Scripts are executed within the task's environment, and `check_restart` stanzas will apply to the specified task. For `checks` on group level `services` only. Inherits the [`service.task`][service_task] value if not - set. + set. May only be set for script or gRPC checks. - `timeout` `(string: )` - Specifies how long Consul will wait for a health check query to succeed. This is specified using a label suffix like