Skip to content

Commit

Permalink
Merge pull request #156 from simon3z/v0.8.z
Browse files Browse the repository at this point in the history
Add content-type header = application/json for create and update actions
  • Loading branch information
simon3z committed Mar 8, 2016
2 parents 64725db + e0adaee commit 331993a
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 331993a

Please sign in to comment.