maclof / kubernetes-client

A simple yet elegant client for accessing and controlling a Kubernetes cluster (https://github.com/kubernetes/kubernetes)
MIT License
231 stars 82 forks source link

Added applyJsonPatch function #90

Closed b-t-927 closed 3 years ago

b-t-927 commented 3 years ago

At the moment there doesn't seem to be a way to apply a json patch object.

The applyJsonPatch() function will perform a PATCH request against the provided model with the content-type set to application/json-patch+json and the provided json patch array as the body.

Example json patch array:

[
    [ 'op' => 'remove', 'path' => '/metadata/labels/foo' ],
   [ 'op' => 'remove', 'path' => '/metadata/labels/bar' ]
]
maclof commented 3 years ago

Thank you! This is awesome :)