Skip to content

Commit 501608c

Browse files
authored
docs: document handling of unset affinity/constraint values (#26354)
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
1 parent b286a8e commit 501608c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ allocations.
8989
For a detailed explanation of these values and their behavior, please see
9090
the [operator values section](#operator-values).
9191

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

9798
- `weight` `(integer: 50)` - Specifies a weight for the affinity. The weight is used
9899
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
@@ -99,7 +99,9 @@ allocations.
9999
- `value` `(string: "")` - Specifies the value to compare the attribute against
100100
using the specified operation. This can be a literal value, another attribute,
101101
or any [Nomad interpolated
102-
values](/nomad/docs/reference/runtime-variable-interpolation#interpreted_node_vars).
102+
values](/nomad/docs/reference/runtime-variable-interpolation#interpreted_node_vars). The
103+
value field is required except for when using the `is_set`, `is_not_set`,
104+
`distinct_hosts`, or `distinct_property` operators.
103105

104106
### `operator` values
105107

0 commit comments

Comments
 (0)