FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/scripts/rest_client_patch.diff at master · nmgliangwei/python · GitHub
nmgliangwei
/
python
Public
forked from
kubernetes-client/python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
scripts
/
rest_client_patch.diff
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (15 loc) · 794 Bytes
Breadcrumbs
python
/
scripts
/
rest_client_patch.diff
Copy path
File metadata and controls
15 lines (15 loc) · 794 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)
Back
|
FazBrowse Home
|
New Git URL