kubeclient
kubeclient copied to clipboard
delete_namespaces("") deletes all namespaces
Thankfully, it does it with --cascade false, but this seems like improper behavior. Is there any reason why an empty string corresponds to all for an entity function? Maybe this shouldn't be the delete default behavior.
Does not sound like a desired behavior. Might be related to https://github.com/abonas/kubeclient/blob/1e7e4f4db3c3f79985651db298d60f6ca31be778/lib/kubeclient/common.rb#L302.
@Ryan-Rose-Bose can you add a reproducer? I could not reproduce with master:
client = Kubeclient::Client.new(
'https://<IP>:8443/api',
'v1',
ssl_options: { verify_ssl: 0 },
auth_options: { bearer_token: <TOKEN>})
puts client.get_namespaces.map {|ns| ns.metadata.name}
client.delete_namespaces("")
> /home/mtayer/.rvm/gems/ruby-2.3.2/gems/kubeclient-2.4.0/lib/kubeclient/common.rb:91:in `method_missing': undefined method `delete_namespaces' for #<Kubeclient::Client:0x000000025f1458> (NoMethodError)
Did you mean? delete_namespace
same happens when doing get_node '' ... returns all nodes ... that was fun to debug :D