Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of lang/funcs: Fix alltrue/anytrue with unknowns into v0.14 #27240

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #27237 to be assessed for backporting due to the inclusion of the label 0.14-backport.

The below text is copied from the body of the original PR.


The alltrue/anytrue functions did not correctly handle unknown values. This commit changes these functions so that the result is unknown if:

  • The list argument is unknown
  • For alltrue: any elements are unknown
  • For anytrue: any elements are unknown and no known elements are true

The last change is a little subtle, so there are test cases to cover it specifically. Examples:

  • anytrue(unknown) = unknown
  • anytrue(false, unknown) = unknown
  • anytrue(false, unknown, true) = true

Intended for backport to a future 0.14 patch release.

Fixes #27236

@teamterraform teamterraform force-pushed the backport/alisdair/alltrue-anytrue-unknown/formerly-closing-longhorn branch from d4b263e to 600cbe5 Compare December 10, 2020 17:45
@alisdair alisdair self-assigned this Dec 10, 2020
@codecov
Copy link

codecov bot commented Dec 10, 2020

Codecov Report

Merging #27240 (600cbe5) into v0.14 (68243b9) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
lang/funcs/collection.go 79.13% <100.00%> (+2.09%) ⬆️
communicator/communicator.go 78.43% <0.00%> (-3.93%) ⬇️

@alisdair alisdair merged commit 92aee5a into v0.14 Dec 10, 2020
@alisdair alisdair deleted the backport/alisdair/alltrue-anytrue-unknown/formerly-closing-longhorn branch December 10, 2020 18:20
@ghost
Copy link

ghost commented Jan 10, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants