patch_resource
Patch a Kubernetes resource with a strategic merge patch or JSON patch. Works on custom resources too - provide the Kind and api_version from the cluster snapshot CRD index. For non-core kinds the live resource is fetched first and the patch is rejected if it is ArgoCD-managed unless allow_bypass=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Resource kind (e.g., 'Deployment', 'ConfigMap'). For custom resources use the Kind from the cluster snapshot CRD index. | |
| name | Yes | Resource name to patch. | |
| patch | Yes | Patch content. Use a JSON object for patch_type 'strategic' or 'merge'. Use a JSON array of {op, path, value} entries (RFC 6902) for patch_type 'json'. | |
| dry_run | No | If true, preview the change without executing it. | |
| namespace | No | Kubernetes namespace. | |
| cluster_id | Yes | Ankra cluster id (UUID) the call targets. Discover ids with list_clusters. | |
| patch_type | No | Type of patch operation. Strategic merge is not supported by custom resources; use 'merge' or 'json' for them. 'strategic' and 'merge' require patch to be an object; 'json' requires patch to be an array of {op, path, value} entries. | strategic |
| api_version | No | API version (e.g., 'v1', 'apps/v1', or '<group>/<version>' for custom resources from the snapshot CRD index). | v1 |
| allow_bypass | No | Bypass the ArgoCD-managed-resource safety check. Set ONLY when the user explicitly asked to override ArgoCD (e.g. 'force', 'bypass argo'). The confirmation dialog still appears with an enhanced warning. |