scheduler: fix r:value taint handling (INFRA-4010) - #12
Draft
cmlad wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
missing_or_contains_anyplacement operand for constraints and affinities${meta.t-r}affinities stored asset_contains_anywith the corrected missing-or-contains-any behaviorWhy
Nomad's constraint model cannot otherwise express
is_not_set OR set_contains_any. Legacyr:valuetaint affinities therefore rejected nodes without${meta.t-r}, even though missing metadata should be tolerated.The compatibility behavior is applied only during scheduler affinity evaluation for the exact, case-sensitive
${meta.t-r}plusset_contains_anycombination. It uses a local effective operand and does not mutate stored job or affinity data. Constraints, device affinities, other metadata keys, and other operands keep their existing behavior.Validation
go test ./...fromapi/— passgo test -vet=off ./nomad/structs— passgo test ./scheduler -run 'Test(ConstraintChecker|CheckConstraint|CheckAttributeConstraint|NodeAffinityIterator|MatchesAffinity)'— passgit diff --check— passgo test ./scheduler— affected tests pass; the package remains red on unrelated existing spread/binpack expectation tests (TestSpread_ImplicitTargets,TestServiceSched_Spread, andTestServiceSched_JobRegister_SchedulerAlgorithm)go test ./nomad/structs— blocked by the existing vet error innomad/structs/volumes.go:193; the package passes with vet disabledwebsite/node_modulesis not installedFollow-up
missing_or_contains_anyand legacy jobs have been replaced, remove the exact${meta.t-r}compatibility bridge and its legacy-only tests; retain the general operand