From e0adaee7aeef6cdf20601e387ce7e5e617e0aab9 Mon Sep 17 00:00:00 2001 From: Alissa Bonas Date: Tue, 23 Feb 2016 17:06:17 +0200 Subject: [PATCH] Add content-type header = application/json for create and update actions Following PR Split codec from scheme #17922 on k8s server. --- lib/kubeclient/common.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/kubeclient/common.rb b/lib/kubeclient/common.rb index 14f6e24c..15fb8c59 100644 --- a/lib/kubeclient/common.rb +++ b/lib/kubeclient/common.rb @@ -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) @@ -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)