Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/kubeclient/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,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
hash[:kind] = 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))
Expand Down