Skip to content

Conditionals with unknown conditions and marked branches are erroring. #629

@cube2222

Description

@cube2222

Hey!

Conditionals that have an unknown condition and one of its branches is marked (sensitive) break with an error because the new refinement handling code in the conditional doesn't handle this case (and v.Range() doesn't handle the case of being a marked unknown).

This has been submitted to OpenTofu as an issue and was later also raised in the HashiCorp Terraform issue tracker.

Here's a brief reproduction:

output "test" {
  value = var.test != "papaya" ? var.test : ""
}

variable "test" {
  type      = string
  default   = "papaya"
  sensitive = true
}

PR to fix this coming in a moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions