forked from kubernetes-client/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py | ||
index 65fbe95..e174317 100644 | ||
--- a/kubernetes/client/rest.py | ||
+++ b/kubernetes/client/rest.py | ||
@@ -152,6 +152,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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters