{
  "name": "kubectl-rollout-undo",
  "title": "Roll back a workload",
  "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-rollout-undo/1.0.0.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/kubectl-rollout-undo/1.0.0/template.yaml",
  "entrypoint": "undo",
  "parameters": [
    {
      "name": "name",
      "title": "Name",
      "description": "Name of the workload.",
      "type": "string",
      "required": true,
      "example": "checkout-api"
    },
    {
      "name": "kind",
      "title": "Kind",
      "description": "Kind of workload to roll back.",
      "type": "string",
      "required": false,
      "default": "deployment",
      "enum": [
        "deployment",
        "statefulset",
        "daemonset"
      ]
    },
    {
      "name": "namespace",
      "title": "Namespace",
      "description": "Namespace the resource lives in.",
      "type": "string",
      "required": false,
      "default": "default",
      "example": "default"
    },
    {
      "name": "timeout",
      "title": "Timeout",
      "description": "Longest time to wait for the rollback to finish, such as 300s or 5m.",
      "type": "string",
      "required": false,
      "default": "300s"
    },
    {
      "name": "to-revision",
      "title": "To revision",
      "description": "Revision number to return to. Leave blank to go back one revision.",
      "type": "string",
      "required": false,
      "default": "",
      "example": "4"
    }
  ],
  "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-rollout-undo/1.0.0/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/kubectl-rollout-undo/1.0.0/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: kubectl-rollout-undo\n  labels:\n    dagweave.io/catalog-item: kubectl-rollout-undo\n  annotations:\n    dagweave.io/catalog-version: \"1.0.0\"\n    dagweave.io/catalog-category: \"Kubernetes\"\nspec:\n  entrypoint: undo\n  templates:\n    - name: undo\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. The rollback patches\n            a workload in the apps group, which that account cannot touch, so the step fails\n            on a 403 rather than touching anything. The cluster you meant is one this run\n            cannot reach.\n      inputs:\n        parameters:\n          - name: kind\n            default: \"deployment\"\n          - name: name\n          - name: namespace\n            default: \"default\"\n          - name: to-revision\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            set -- \"${KIND}/${NAME}\" -n \"${NAMESPACE}\"\n            if [ -n \"${TO_REVISION}\" ]; then set -- \"$@\" --to-revision=\"${TO_REVISION}\"; fi\n            kubectl rollout undo \"$@\"\n            kubectl rollout status \"${KIND}/${NAME}\" -n \"${NAMESPACE}\" --timeout=\"${TIMEOUT}\"\n        env:\n          - name: KIND\n            value: \"{{inputs.parameters.kind}}\"\n          - name: NAME\n            value: \"{{inputs.parameters.name}}\"\n          - name: NAMESPACE\n            value: \"{{inputs.parameters.namespace}}\"\n          - name: TO_REVISION\n            value: \"{{inputs.parameters.to-revision}}\"\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": "890e2e338ce5d6c79dc1853ec502c9d44556278c4fcf6f3019b7f90797ca65ff",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/kubectl-rollout-undo",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
