how to patch configmap field using python client library
The body
parameter in patch_namespaced_config_map
is the actual configmap
data that you want to patch and needs to be first obtained with read_namespaced_config_map
.
Following steps are required for all the operations that have the body
argument:
- Get the data using the
read_*/get_*
method - Use the data returned in the first step in the API modifying the object.
Further, for most cases, it is enough to pass the required arguments namelyname
, namespace
and body
but here is the info about each:
Parameters
Name | Type | Description | Notes |
---|---|---|---|
name | str | name of the ConfigMap | |
namespace | str | object name and auth scope, such as for teams and projects | |
body | object | ||
pretty | str | If 'true', then the output is pretty printed. | [optional] |
dry_run | str | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] |
field_manager | str | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] |
force | bool | Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] |
Review the K8s python client README for the list of all supported APIs and their usage.