Skip to content

Commit 1b0efe4

Browse files
committed
fix rest client patch and re-apply it
1 parent 1712b52 commit 1b0efe4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

kubernetes/client/rest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ def request(self, method, url, query_params=None, headers=None,
155155
if query_params:
156156
url += '?' + urlencode(query_params)
157157
if re.search('json', headers['Content-Type'], re.IGNORECASE):
158+
if headers['Content-Type'] == 'application/json-patch+json':
159+
if not isinstance(body, list):
160+
headers['Content-Type'] = \
161+
'application/strategic-merge-patch+json'
158162
request_body = None
159163
if body is not None:
160164
request_body = json.dumps(body)

scripts/rest_client_patch.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py
2-
index 13b16c2f..41c53429 100644
2+
index 0bb15d8..acf7b2b 100644
33
--- a/kubernetes/client/rest.py
44
+++ b/kubernetes/client/rest.py
55
@@ -155,6 +155,10 @@ class RESTClientObject(object):

0 commit comments

Comments
 (0)