garethr / garethr-kubernetes

Puppet types and provider for managing Pods, ReplicationControllers, Services and more in Kubernetes
http://garethr.github.io/garethr-kubernetes
Apache License 2.0
28 stars 28 forks source link

Problem while using kubernetes_ingress #46

Open fgallese opened 5 years ago

fgallese commented 5 years ago

It seems to me that there is a bug when handling the resource kubernetes_ingress.

In the file lib/puppetx/puppetlabs/kubernetes/provider.rb at line 73 there is a call to "get#{type}s":

def self.list_instances_of(type)
   call("get_#{type}s")
end

Problem is, when type is "ingress" then this resolves to "get_ingresss", which is invalid:

Error: Could not run: Puppet detected a problem with the information returned from the service when accessing kubernetes_ingress. The specific error was:
   undefined method `get_ingresss' for #<Kubeclient::Client:0x0000000002fdb748>
Did you mean?  get_ingresses
               get_ingress

There should be some control in place for the name. I will provide a PR with the fix that I tryied and worked.