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

Update conditionals.mdx #36128

Merged
merged 3 commits into from
Nov 29, 2024
Merged

Update conditionals.mdx #36128

merged 3 commits into from
Nov 29, 2024

Conversation

reddynn
Copy link
Contributor

@reddynn reddynn commented Nov 28, 2024

this change just conditional error in the document

@reddynn reddynn requested review from a team as code owners November 28, 2024 08:42
Copy link

hashicorp-cla-app bot commented Nov 28, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@radeksimko
Copy link
Member

Hi @reddynn Can you please clarify what is wrong with the conditional currently? As far as I can tell it is just an example, so any operator is relevant there.

@radeksimko radeksimko added the waiting-response An issue/pull request is waiting for a response from the community label Nov 28, 2024
@reddynn
Copy link
Contributor Author

reddynn commented Nov 28, 2024

in the explanation mentioned as If var.a is an empty string then the result is "default-a" ,according to explanation there should not be "not equal operator" in condition

@radeksimko
Copy link
Member

I see - good catch.

In that case however it should be == (double equal sign) as per https://developer.hashicorp.com/terraform/language/expressions/operators#equality-operators

@reddynn
Copy link
Contributor Author

reddynn commented Nov 28, 2024

updated the code changes according to suggestion

@radeksimko
Copy link
Member

Actually I stand corrected - the comment matches the behaviour in the original example. The conditional expression works like this:

CONDITION ? TRUE : FALSE

I think we could still remove the != like proposed because negatives tend to be more confusing but now the comment is incorrect, so we either need to swap the two arguments or update the comment.

@reddynn
Copy link
Contributor Author

reddynn commented Nov 29, 2024

its better to update arguments, so readers can avoid confusion, i updated the arguments please check

@radeksimko radeksimko merged commit 43c0891 into hashicorp:main Nov 29, 2024
3 checks passed
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants