Invoking shutil.rmtree() first was causing a traceback since the max
open files setting was still set very low for the test. This moves the
shutil.rmtree() until after we have restored the original resource
limit.
* Add 100% test coverage for the kubernetes.node_label_absent state
* Add 100% test coverage for the kubernetes.namespace_present state
* Add 100% test coverage for the kubernetes.namespace_absent state
* Add 100% test coverage for the kubernetes.secret_absent state
* Add 100% coverage for kubernetes.node_label_present
* Also add 'comment' to kubernetes.node_add_label
* Make the faux test objects more believable in test_kubernetes.py
* Add 100% test coverage for the kubernetes.secret_present state
* Add 100% test coverage for the kubernetes.configmap_absent state
* Add 100% test coverage for the kubernetes.configmap_present state
* Make some fields optional to kubernetes.create_secret and add examples
* Make some fields optional to kubernetes.replace_secret and add examples
* Make some fields optional to kubernetes.create_configmap and add examples
* Make some fields optional to kubernetes.replace_configmap and add examples
* Add 'comment' when a kubernetes configmap or secret is going to be replaced
* Update 'source', 'template', and 'saltenv' kwargs to defaults from the rest of the codebase
* Allow passing empty 'data' to the kubernetes.configmap_present state to remove the existing contents
This allows commands such as `kubectl rollout history deploy/$FOO` to
automatically show the deployment changed as a result of the salt run
and follows exactly how kubectl works when passed the `--record` flag.
When the `client_key_file` attribute was defined and the `client_key`
attribute was not, the conditional for `client_key` would wrongly zero
`kubernetes.client.configuration.key_file`.
This was a bit annoying to figure out, but the kubernetes module now can
authenticate with minikube with a configuration such as this (where jeff
is $USER):
kubernetes.api_url: 'https://192.168.99.100:8443'
kubernetes.certificate-authority-file: '/home/jeff/.minikube/ca.crt'
kubernetes.client-certificate-file: '/home/jeff/.minikube/client.crt'
kubernetes.client-key-file: '/home/jeff/.minikube/client.key'
The various options can be gotten from ~/.kube/config after running `minikube start`.