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

Support resource status conditions using wait_for in kubectl_manifest #155

Open
jkabonickAtOlo opened this issue Aug 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jkabonickAtOlo
Copy link
Contributor

jkabonickAtOlo commented Aug 7, 2024

We have a use-case where we want to wait for specific status conditions to be true on manifests that are installed with this provider. This is currently being done using multiple conditions as mentioned in this comment. However, using an index on a list object is problematic since there is no guarantee of ordering.

I'd like to propose extending the wait_for block, specifically to support waiting for status conditions. The Hashicorp Kubernetes provider offers support for this on its kubernetes_manifest resource. However, there are issues with that provider that prevent us from using it for our use-case.

For example, extending it to allow a new condition block could allow waiting for specific status conditions to be satisfied, in addition to the generic fields provided.

wait_for {
    condition {
      type = "ContainersReady"
      status = "True"
    }
    condition {
      type = "Ready"
      status = "True"
    }
    field {
      key = "status.containerStatuses.[0].ready"
      value = "True"
    }
    field {
      key = "status.phase"
      value = "Running"
    }
    field {
      key = ""status.containerStatuses.[0].ready""
      value = "True"
    }
  }

I'm happy to open a PR if you are open to contributions.

@jkabonickAtOlo jkabonickAtOlo changed the title Support resource status conditions using wait_for in kubernetes_manifest Support resource status conditions using wait_for in kubectl_manifest Aug 7, 2024
@alekc
Copy link
Owner

alekc commented Aug 9, 2024

Hi @jkabonickAtOlo,

I am not against this (and proposed implementation above is not a breaking change). All PR are welcome (but please add some tests as well covering new functionality).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants