Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80831d0

Browse files
Benjamin Shermanmbohlool
Benjamin Sherman
authored andcommitted
fix for kubernetes-client#187 failure when using RFC 6902 json-patch operation
1 parent 78790ac commit 80831d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kubernetes/client/rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def request(self, method, url, query_params=None, headers=None,
154154
if query_params:
155155
url += '?' + urlencode(query_params)
156156
if headers['Content-Type'] == 'application/json-patch+json':
157-
headers[
158-
'Content-Type'] = 'application/strategic-merge-patch+json'
157+
if not isinstance(body, list):
158+
headers['Content-Type'] = 'application/strategic-merge-patch+json'
159159
request_body = None
160160
if body:
161161
request_body = json.dumps(body)

0 commit comments

Comments
 (0)