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

Skip to content

Commit ccc9809

Browse files
authored
Merge pull request kubernetes-client#205 from bsherman/2.0patch-fix
fix for kubernetes-client#187 failure when using RFC 6902 json-patch operation
2 parents f4d943b + e4c5cc7 commit ccc9809

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v2.0.0b2
2+
- Bugfix: support RFC6902 'json-patch' operations #187
3+
14
# v1.0.1
25
- Bugfix: urllib3 1.21 fails tests, Excluding version 1.21 from dependencies #197
36

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)