mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
k8s_cp - a new module for copying files to/from a Pod (#127)
* k8s_cp module * add documentation for k8s_cp module * add doc for the new module * pods should be running * support for binary, archive and zip file * sanity * Delete file.txt * remove unused * set back * Update collection.txt * Update test_copy_errors.yml * Update plugins/modules/k8s_cp.py Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com> * Update k8s_cp.py * Update k8s_cp.py * tar binary requirements * Update common.py * Update k8s_cp.py * Update k8s_cp.py * replace kind with binary file * Update test_copy_large_file.yml * Update plugins/action/k8s_info.py Co-authored-by: Mike Graves <mgraves@redhat.com> * Update k8s_info.py * Update k8s_info.py * Update k8s_cp.py Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com> Co-authored-by: Mike Graves <mgraves@redhat.com>
This commit is contained in:
@@ -208,13 +208,13 @@ get_api_client._pool = {}
|
||||
|
||||
class K8sAnsibleMixin(object):
|
||||
|
||||
def __init__(self, module, *args, **kwargs):
|
||||
def __init__(self, module, pyyaml_required=True, *args, **kwargs):
|
||||
if not HAS_K8S_MODULE_HELPER:
|
||||
module.fail_json(msg=missing_required_lib('kubernetes'), exception=K8S_IMP_ERR,
|
||||
error=to_native(k8s_import_exception))
|
||||
self.kubernetes_version = kubernetes.__version__
|
||||
|
||||
if not HAS_YAML:
|
||||
if pyyaml_required and not HAS_YAML:
|
||||
module.fail_json(msg=missing_required_lib("PyYAML"), exception=YAML_IMP_ERR)
|
||||
|
||||
def find_resource(self, kind, api_version, fail=False):
|
||||
|
||||
Reference in New Issue
Block a user