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

HTTP status 404 when creating namespace with labels #36

Open rolandkool opened 6 years ago

rolandkool commented 6 years ago

When creating a namespace on Kubernetes with labels set, it fails with a 404.

kubernetes_namespace { 'mynamespace': ensure => present, metadata => { labels => { 'key1' => 'value1', 'key2' => 'value2', }, }, }

The error:

Error: Could not set 'present' on ensure: HTTP status code 404, the server could not find the requested resource

When you create namespace without labels and add them afterwards, no changes are detected.

teintuc commented 6 years ago

Hi,

I have no answer about the problem of namespace creation. I'm had that kind of problem with other resources. Have to look at it.

Although, I had the same problem when trying to update my kubernetes resources (add services annotations or adding env variable to my deployments). I opened a PR to fix this problem PR#38

Regards