{
  "name": "kubectl-wait-condition",
  "title": "Wait for a Kubernetes condition",
  "category": "Kubernetes",
  "tags": [
    "kubectl",
    "kubernetes"
  ],
  "version": "1.0.0",
  "date": "2026-10-18",
  "notes": "Initial release.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/kubectl-wait-condition/1.0.0.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/kubectl-wait-condition/1.0.0/template.yaml",
  "entrypoint": "wait",
  "parameters": [
    {
      "name": "resource",
      "title": "Resource",
      "description": "What to wait on: kind/name, or just a kind when a label selector picks the objects.",
      "type": "string",
      "required": true,
      "example": "deployment/checkout-api"
    },
    {
      "name": "condition",
      "title": "Condition",
      "description": "What to wait for, in kubectl wait --for form.",
      "type": "string",
      "required": false,
      "default": "condition=Ready",
      "example": "condition=Available"
    },
    {
      "name": "namespace",
      "title": "Namespace",
      "description": "Namespace the resource lives in.",
      "type": "string",
      "required": false,
      "default": "default",
      "example": "default"
    },
    {
      "name": "selector",
      "title": "Selector",
      "description": "Label selector that picks the objects when resource is only a kind. Leave blank to wait on one named object.",
      "type": "string",
      "required": false,
      "default": "",
      "example": "app=checkout-api"
    },
    {
      "name": "timeout",
      "title": "Timeout",
      "description": "Longest time to wait, such as 300s or 5m.",
      "type": "string",
      "required": false,
      "default": "300s"
    }
  ],
  "images": [
    {
      "ref": "cgr.dev/chainguard/kubectl@sha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba",
      "repository": "cgr.dev/chainguard/kubectl",
      "tag": "latest-dev",
      "digest": "sha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/kubectl-wait-condition/1.0.0/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/kubectl-wait-condition/1.0.0/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: kubectl-wait-condition\n  labels:\n    dagweave.io/catalog-item: kubectl-wait-condition\n  annotations:\n    dagweave.io/catalog-version: \"1.0.0\"\n    dagweave.io/catalog-category: \"Kubernetes\"\nspec:\n  entrypoint: wait\n  templates:\n    - name: wait\n      metadata:\n        annotations:\n          dagweave.io/local-support: unsupported\n          dagweave.io/local-support-reason: \u003e-\n            This step runs kubectl with whatever identity the pod is given. On Dagweave\n            Local that is the default service account of the hidden cluster's argo\n            namespace, which Argo's quick-start install grants create, get and patch on pods\n            and create and get on workflows, and nothing anywhere else. Waiting means\n            reading the resource, and that account cannot read anything outside pods and\n            workflows, so the step fails on a 403 rather than touching anything. The cluster\n            you meant is one this run cannot reach.\n      inputs:\n        parameters:\n          - name: resource\n          - name: namespace\n            default: \"default\"\n          - name: condition\n            default: \"condition=Ready\"\n          - name: selector\n            default: \"\"\n          - name: timeout\n            default: \"300s\"\n      retryStrategy:\n        limit: \"2\"\n        retryPolicy: OnError\n        backoff:\n          duration: 10s\n          factor: \"2\"\n          maxDuration: 2m\n      container:\n        # cgr.dev/chainguard/kubectl:latest-dev\n        image: cgr.dev/chainguard/kubectl@sha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba\n        command: [sh, -c]\n        args:\n          - |\n            set -eu\n            if [ -n \"${SELECTOR}\" ]; then\n              kubectl wait \"${RESOURCE}\" -n \"${NAMESPACE}\" -l \"${SELECTOR}\" --for=\"${CONDITION}\" --timeout=\"${TIMEOUT}\"\n            else\n              kubectl wait \"${RESOURCE}\" -n \"${NAMESPACE}\" --for=\"${CONDITION}\" --timeout=\"${TIMEOUT}\"\n            fi\n        env:\n          - name: RESOURCE\n            value: \"{{inputs.parameters.resource}}\"\n          - name: NAMESPACE\n            value: \"{{inputs.parameters.namespace}}\"\n          - name: CONDITION\n            value: \"{{inputs.parameters.condition}}\"\n          - name: SELECTOR\n            value: \"{{inputs.parameters.selector}}\"\n          - name: TIMEOUT\n            value: \"{{inputs.parameters.timeout}}\"\n        resources:\n          requests:\n            cpu: 50m\n            memory: 64Mi\n          limits:\n            memory: 256Mi\n",
  "templateSha256": "d2b72f1e5051e090513aff8cba47bb69d55ca62c2f7bc91b1359cc9b203d540b",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/kubectl-wait-condition",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
