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

Allow kubeclient gem installation with puppet itself. #5

Closed modax closed 8 years ago

modax commented 8 years ago

Without this change, compilation of the catalog fails where there is no kubeclient. What is more, it is now possible both to install kubeclient via puppet itself and deploy descriptors in a single puppet run. As a side effect, puppet master no longer needs to have kubeclient library installed.

Based on sensu-puppet, http://alcy.github.io/2012/11/21/handling-gem-dependencies-in-custom-puppet-providers/

Some details:

1) require 'kubeclient' removed since it is done magically and lazily upon provider evaluation via confine :feature => :kubeclient. See https://projects.puppetlabs.com/issues/17747#note-8

2) require 'recursive_open_struct' removed and ensure_value_at_path moved to provider itself since we don't want to require any external libraries prematurely.

3) 'subclass.confine :feature => :kubeclient' is called on each provider subclass.

garethr commented 8 years ago

@modax apologies, I'd managed to have notifications switched off on this repo and missed these. Thanks a lot, much appreciated. I'll get to having a proper look soon and hopefully merge everything in.