Merge branch 'kubernetes-client:master' into master
This commit is contained in:
commit
ab58e5cfc9
@ -15,7 +15,6 @@
|
||||
import time
|
||||
import unittest
|
||||
import uuid
|
||||
import json
|
||||
|
||||
from kubernetes.e2e_test import base
|
||||
from kubernetes.client import api_client
|
||||
@ -527,9 +526,8 @@ class TestDynamicClient(unittest.TestCase):
|
||||
'ports': [{'containerPort': 80,
|
||||
'protocol': 'TCP'}]}]}}
|
||||
|
||||
body = json.dumps(pod_manifest).encode()
|
||||
resp = api.server_side_apply(
|
||||
name=name, namespace='default', body=body,
|
||||
namespace='default', body=pod_manifest,
|
||||
field_manager='kubernetes-unittests', dry_run="All")
|
||||
self.assertEqual('kubernetes-unittests', resp.metadata.managedFields[0].manager)
|
||||
|
||||
|
||||
@ -157,7 +157,8 @@ class RESTClientObject(object):
|
||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
||||
if query_params:
|
||||
url += '?' + urlencode(query_params)
|
||||
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
||||
if (re.search('json', headers['Content-Type'], re.IGNORECASE) or
|
||||
headers['Content-Type'] == 'application/apply-patch+yaml'):
|
||||
if headers['Content-Type'] == 'application/json-patch+json':
|
||||
if not isinstance(body, list):
|
||||
headers['Content-Type'] = \
|
||||
|
||||
@ -5,7 +5,9 @@ index 65fbe95..e174317 100644
|
||||
@@ -152,6 +152,10 @@ class RESTClientObject(object):
|
||||
if query_params:
|
||||
url += '?' + urlencode(query_params)
|
||||
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
||||
- if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
||||
+ if (re.search('json', headers['Content-Type'], re.IGNORECASE) or
|
||||
+ headers['Content-Type'] == 'application/apply-patch+yaml'):
|
||||
+ if headers['Content-Type'] == 'application/json-patch+json':
|
||||
+ if not isinstance(body, list):
|
||||
+ headers['Content-Type'] = \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user