Support for Bearer authentication

This commit is contained in:
Andrii Kostenko 2017-11-13 16:26:06 +02:00
parent 5a8ba39dd7
commit 4eb3f65776
No known key found for this signature in database
GPG Key ID: B5BDA546B31D35E9

View File

@ -145,6 +145,9 @@ def _setup_conn(**kwargs):
kubernetes.client.configuration.host = host kubernetes.client.configuration.host = host
kubernetes.client.configuration.user = username kubernetes.client.configuration.user = username
kubernetes.client.configuration.passwd = password kubernetes.client.configuration.passwd = password
if __salt__['config.option']('kubernetes.api_key'):
kubernetes.client.configuration.api_key = {'authorization': __salt__['config.option']('kubernetes.api_key')}
kubernetes.client.configuration.api_key_prefix = {'authorization': __salt__['config.option']('kubernetes.api_key_prefix')}
if ca_cert_file: if ca_cert_file:
kubernetes.client.configuration.ssl_ca_cert = ca_cert_file kubernetes.client.configuration.ssl_ca_cert = ca_cert_file