From d54e4f7094e3bd3c0055ab5cf01427fa45079b67 Mon Sep 17 00:00:00 2001 From: Beni Cherniavsky-Paskin Date: Thu, 31 May 2018 17:58:33 +0300 Subject: [PATCH] [WIP] [EXPERIMENT] don't set kind, apiVersion Can we revert https://github.com/abonas/kubeclient/pull/58? Seems https://github.com/kubernetes/kubernetes/issues/6439 fixed - from which kubernetes version? https://github.com/kubernetes/kubernetes/pull/10200 landed in v1.1.0. --- lib/kubeclient/common.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/kubeclient/common.rb b/lib/kubeclient/common.rb index de100ff8..a123dbcf 100644 --- a/lib/kubeclient/common.rb +++ b/lib/kubeclient/common.rb @@ -306,17 +306,11 @@ def delete_entity(resource_name, name, namespace = nil, delete_options: {}) def create_entity(entity_type, resource_name, entity_config) # Duplicate the entity_config to a hash so that when we assign # kind and apiVersion, this does not mutate original entity_config obj. + # TODO: skip? hash = entity_config.to_hash ns_prefix = build_namespace_prefix(hash[:metadata][:namespace]) - # TODO: temporary solution to add "kind" and apiVersion to request - # until this issue is solved - # https://github.com/GoogleCloudPlatform/kubernetes/issues/6439 - # TODO: #2 solution for - # https://github.com/kubernetes/kubernetes/issues/8115 - hash[:kind] = (entity_type.eql?('Endpoint') ? 'Endpoints' : entity_type) - hash[:apiVersion] = @api_group + @api_version response = handle_exception do rest_client[ns_prefix + resource_name] .post(hash.to_json, { 'Content-Type' => 'application/json' }.merge(@headers))