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

Updating kubernetes_resource_quota or kubernetes_limit_range doesn't work #37

Open rolandkool opened 7 years ago

rolandkool commented 7 years ago

Hi

When you have a managed kubernetes_resource_quota or kubernetes_limit_range and you change one of the configured limits, it fails with:

Error: undefined method `keys' for 3:Fixnum

Example resource kubernetes_resource_quota { 'my_quota': ensure => present, metadata => { namespace => 'mynamespace', }, spec => { hard => { 'limits.cpu' => '2', 'limits.memory' => '16Gi', } }, } If you change limits.cpu from 2 to 3 or change the memory setting, you'll run into that error.

teintuc commented 7 years ago

Hi,

I had the same problem with Strings. It comes from the function "fuzzy_compare" of gareth's swagger puppet generator (used to generate this module). A pull request has been opened to fix it #5

You should update your kubernetes module with this fix. I have been using it since a day. Seems ok so far