Skip to content

Commit 331993a

Browse files
committed
Merge pull request #156 from simon3z/v0.8.z
Add content-type header = application/json for create and update actions
2 parents 64725db + e0adaee commit 331993a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/kubeclient/common.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def create_entity(entity_type, entity_config, klass)
194194
# https://github.com/GoogleCloudPlatform/kubernetes/issues/6439
195195
hash['kind'] = entity_type
196196
hash['apiVersion'] = @api_version
197+
@headers['Content-Type'] = 'application/json'
197198
response = handle_exception do
198199
rest_client[ns_prefix + resource_name(entity_type)]
199200
.post(hash.to_json, @headers)
@@ -208,6 +209,7 @@ def update_entity(entity_type, entity_config)
208209
# struct
209210
hash = entity_config.to_hash
210211
ns_prefix = build_namespace_prefix(entity_config.metadata['table'][:namespace])
212+
@headers['Content-Type'] = 'application/json'
211213
handle_exception do
212214
rest_client[ns_prefix + resource_name(entity_type) + "/#{name}"]
213215
.put(hash.to_json, @headers)

0 commit comments

Comments
 (0)