Skip to content

Commit eaa1d42

Browse files
Backport of docs: document handling of unset affinity/constraint values (#26354) (#26381)
Affinities and contraints use similar feasibility checking logic to determine if a given node matches (although affinities don't support all the same operators). Most operators don't allow `value` to be unset. Update the docs to reflect this. Fixes: #24983 Co-authored-by: Tim Gross <[email protected]>
1 parent 9ce2642 commit eaa1d42

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

website/content/docs/job-specification/affinity.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ restricted only to nodes that meet the constraint's criteria.
8787
For a detailed explanation of these values and their behavior, please see
8888
the [operator values section](#operator-values).
8989

90-
- `value` `(string: "")` - Specifies the value to compare the attribute against
91-
using the specified operation. This can be a literal value, another attribute,
92-
or any [Nomad interpolated
93-
values](/nomad/docs/runtime/interpolation#interpreted_node_vars).
90+
- `value` `(string: <required>)` - Specifies the value to compare the attribute
91+
against using the specified operation. This can be a literal value, another
92+
attribute, or any [Nomad interpolated
93+
values](/nomad/docs/runtime/interpolation#interpreted_node_vars). The `value`
94+
field is required.
9495

9596
- `weight` `(integer: 50)` - Specifies a weight for the affinity. The weight is used
9697
during scoring and must be an integer between -100 to 100. Negative weights act as

website/content/docs/job-specification/constraint.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ all groups (and tasks) in the job.
9696
- `value` `(string: "")` - Specifies the value to compare the attribute against
9797
using the specified operation. This can be a literal value, another attribute,
9898
or any [Nomad interpolated
99-
values](/nomad/docs/runtime/interpolation#interpreted_node_vars).
99+
values](/nomad/docs/runtime/interpolation#interpreted_node_vars). The value
100+
field is required except for when using the `is_set`, `is_not_set`,
101+
`distinct_hosts`, or `distinct_property` operators.
100102

101103
### `operator` Values
102104

0 commit comments

Comments
 (0)