Skip to content

Allow multiple watch types for kubernetes_manifest resources #2798

@matthewjwhite

Description

@matthewjwhite

Description

I am unable to use multiple watch types for a kubernetes_manifest resource. For example, I can't specify both fields and condition.

wait {
  fields = {
    "status.observedGeneration" = "5"

  condition {
    type = "blah"
    status = "True"
  }
}

The above fails with:

 Error: Invalid wait configuration
│
│   with kubernetes_manifest.test,
│   on resource.tf line 18, in resource "kubernetes_manifest" "test":
│   18: resource "kubernetes_manifest" "test" {
│
│ You may only set one of "condition", "fields".

An example where this would be useful is if I want to wait until observedGeneration matches the expected value and that a certain set of conditions are true. For example, consider a Controller that resets the conditions to false at the time of bumping the observedGeneration and further action is required to bring them to true. If I want to wait until reconciliation has totally completed, I'm unable to do so.

I am able to emulate a condition check with a fields check, but that requires that you know the index of the target condition (as Conditions are conventionally a list of conditions rather than a map). For example:

  wait {
    fields = {
      "status.observedGeneration" = "5"
      "status.conditions[0].status" = "True"
    }
  }
}

It would be nice to be able to use condition, fields, and even rollout together.

Has this been considered before, or is there another way to achieve this?

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions