Skip to content

Commit

Permalink
Add content-type header = application/json for create and update actions
Browse files Browse the repository at this point in the history
Following PR  Split codec from scheme #17922 on k8s server.
  • Loading branch information
abonas authored and simon3z committed Mar 7, 2016
1 parent 64725db commit e0adaee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/kubeclient/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def create_entity(entity_type, entity_config, klass)
# https://github.com/GoogleCloudPlatform/kubernetes/issues/6439
hash['kind'] = entity_type
hash['apiVersion'] = @api_version
@headers['Content-Type'] = 'application/json'
response = handle_exception do
rest_client[ns_prefix + resource_name(entity_type)]
.post(hash.to_json, @headers)
Expand All @@ -208,6 +209,7 @@ def update_entity(entity_type, entity_config)
# struct
hash = entity_config.to_hash
ns_prefix = build_namespace_prefix(entity_config.metadata['table'][:namespace])
@headers['Content-Type'] = 'application/json'
handle_exception do
rest_client[ns_prefix + resource_name(entity_type) + "/#{name}"]
.put(hash.to_json, @headers)
Expand Down

0 comments on commit e0adaee

Please sign in to comment.