Skip to content

Fix null value check for undrainable_node_behavior#761

Open
skooNI wants to merge 1 commit intoAzure:mainfrom
skooNI:skoo-precondition-null-checks
Open

Fix null value check for undrainable_node_behavior#761
skooNI wants to merge 1 commit intoAzure:mainfrom
skooNI:skoo-precondition-null-checks

Conversation

@skooNI
Copy link
Copy Markdown
Contributor

@skooNI skooNI commented Apr 23, 2026

Describe your changes

PR #733 introduced a precondition to check for the value of undrainable_node_behavior however it fails when the value is null. This happens because Terraform does not short-circuit evaluate || and calls contains with null, which results in an error.

This switches that check to use a ternary operator to check for null, which will short-circuit before calling contains.

Issue number

Closes #760

Checklist before requesting a review

  • The pr title can be used to describe what this pr did in CHANGELOG.md file
  • I have executed pre-commit on my machine
  • I have passed pr-check on my machine

Thanks for your cooperation!

PR Azure#733 introduced a precondition to check for the value of
`undrainable_node_behavior` however it fails when the value is `null`.
This happens because Terraform does not short-circuit evaluate `||` and
calls `contains` with `null`, which results in an error.

This switches that check to use a ternary operator to check for `null`,
which will short-circuit before calling `contains`.

Signed-off-by: Steven Koo <steven.koo@emerson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

undrainable_node_behavior validation fails when set to null

1 participant