oc_patch
Apply targeted updates to OpenShift resources using strategic merge, JSON merge, or JSON patch operations, with dry-run and force options.
Instructions
Patch OpenShift resources with strategic merge, JSON merge, or JSON patch operations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the resource to patch | |
| force | No | Force the patch operation, ignoring conflicts | |
| patch | Yes | Patch content as JSON string or YAML. For strategic merge patch (default), provide the fields to update. For JSON patch, use RFC 6902 format. | |
| dryRun | No | Perform a dry run without making actual changes | |
| context | No | OpenShift context to use (optional) | |
| namespace | No | Namespace/project for the resource (not required for cluster-scoped resources) | default |
| patchType | No | Type of patch operation | strategic |
| subresource | No | Subresource to patch (e.g., status, scale) | |
| fieldManager | No | Field manager name for server-side apply tracking | mcp-openshift-client |
| resourceType | Yes | Type of resource to patch (pod, deployment, service, route, configmap, secret, etc.) | |
| recordHistory | No | Record the patch operation in the resource annotation for rollback purposes |