From a3780d37e2f21ee76746b858fb1e6134610b1f71 Mon Sep 17 00:00:00 2001 From: Charlie Voiselle Date: Tue, 19 Jun 2018 09:27:16 -0400 Subject: [PATCH 1/2] Added warning about impossible constraints This was as a resolution to https://github.com/hashicorp/nomad/issues/4424 --- website/source/docs/job-specification/constraint.html.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/source/docs/job-specification/constraint.html.md b/website/source/docs/job-specification/constraint.html.md index 3a0809393..3105b0a50 100644 --- a/website/source/docs/job-specification/constraint.html.md +++ b/website/source/docs/job-specification/constraint.html.md @@ -28,6 +28,11 @@ filter on [attributes][interpolation] or [client metadata][client-meta]. Additionally constraints may be specified at the [job][job], [group][group], or [task][task] levels for ultimate flexibility. +~> **It is possible to define irreconcilable constraints in a job.** +For example, because all [tasks within a group are scheduled on the same client node][group], +specifying different [`${attr.unique.hostname}`][node-variables] constraints at +the task level will cause a job to be unplaceable. + ```hcl job "docs" { # All tasks in this job must run on linux. @@ -59,6 +64,7 @@ Placing constraints at both the job level and at the group level is redundant since constraints are applied hierarchically. The job constraints will affect all groups (and tasks) in the job. + ## `constraint` Parameters - `attribute` `(string: "")` - Specifies the name or reference of the attribute @@ -273,3 +279,4 @@ constraint { [client-meta]: /docs/agent/configuration/client.html#meta "Nomad meta Job Specification" [task]: /docs/job-specification/task.html "Nomad task Job Specification" [interpolation]: /docs/runtime/interpolation.html "Nomad interpolation" +[node-variables]: /docs/runtime/interpolation.html#node-variables- "Nomad interpolation-Node variables" From ae89587efe5ad6a70ba920f79fee60788fe6a154 Mon Sep 17 00:00:00 2001 From: Charlie Voiselle Date: Tue, 19 Jun 2018 09:30:15 -0400 Subject: [PATCH 2/2] Remove extra linefeed --- website/source/docs/job-specification/constraint.html.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/source/docs/job-specification/constraint.html.md b/website/source/docs/job-specification/constraint.html.md index 3105b0a50..404dbbd01 100644 --- a/website/source/docs/job-specification/constraint.html.md +++ b/website/source/docs/job-specification/constraint.html.md @@ -64,7 +64,6 @@ Placing constraints at both the job level and at the group level is redundant since constraints are applied hierarchically. The job constraints will affect all groups (and tasks) in the job. - ## `constraint` Parameters - `attribute` `(string: "")` - Specifies the name or reference of the attribute