diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py index e268beeb6..e25e4f59f 100644 --- a/kubernetes/client/rest.py +++ b/kubernetes/client/rest.py @@ -155,6 +155,10 @@ class RESTClientObject(object): if query_params: url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): + if headers['Content-Type'] == 'application/json-patch+json': + if not isinstance(body, list): + headers['Content-Type'] = \ + 'application/strategic-merge-patch+json' request_body = None if body is not None: request_body = json.dumps(body) diff --git a/scripts/rest_client_patch.diff b/scripts/rest_client_patch.diff index 46fcf2014..5d514708f 100644 --- a/scripts/rest_client_patch.diff +++ b/scripts/rest_client_patch.diff @@ -1,5 +1,5 @@ diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py -index 13b16c2f..41c53429 100644 +index 0bb15d8..acf7b2b 100644 --- a/kubernetes/client/rest.py +++ b/kubernetes/client/rest.py @@ -155,6 +155,10 @@ class RESTClientObject(object):