kube.py support kubeconfig (#9982)

pull/9986/head
Samuel Liu 2023-04-14 15:14:40 +08:00 committed by GitHub
parent 6682a843b4
commit 73ce6aef97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,11 @@ options:
default: null default: null
description: description:
- The url for the API server that commands are executed against. - The url for the API server that commands are executed against.
kubeconfig:
required: false
default: null
description:
- The path to the kubeconfig.
force: force:
required: false required: false
default: false default: false
@ -126,6 +131,9 @@ class KubeManager(object):
if module.params.get('server'): if module.params.get('server'):
self.base_cmd.append('--server=' + module.params.get('server')) self.base_cmd.append('--server=' + module.params.get('server'))
if module.params.get('kubeconfig'):
self.base_cmd.append('--kubeconfig=' + module.params.get('kubeconfig'))
if module.params.get('log_level'): if module.params.get('log_level'):
self.base_cmd.append('--v=' + str(module.params.get('log_level'))) self.base_cmd.append('--v=' + str(module.params.get('log_level')))
@ -309,6 +317,7 @@ def main():
resource=dict(), resource=dict(),
label=dict(), label=dict(),
server=dict(), server=dict(),
kubeconfig=dict(),
kubectl=dict(), kubectl=dict(),
force=dict(default=False, type='bool'), force=dict(default=False, type='bool'),
wait=dict(default=False, type='bool'), wait=dict(default=False, type='bool'),