Commit Graph

61 Commits

Author SHA1 Message Date
Mike Graves
83b3a1aa39 Use yaml.safe_load in unit tests (#265) (#266)
[backport/2.2] Use yaml.safe_load in unit tests (#265)

Use yaml.safe_load in unit tests
SUMMARY
The function signature in pyyaml 6 for yaml.load changed. Using
safe_load fixes this.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Jill R 
Reviewed-by: None 
Reviewed-by: Gonéri Le Bouder goneri@lebouder.net
(cherry picked from commit 281ff56)

Reviewed-by: None <None>
Reviewed-by: None <None>
2021-10-15 13:02:29 +00:00
Mike Graves
aa41055503 Fix sanity test - devel drops support for python 2.6 (#251) (#258)
Fix sanity test - devel drops support for python 2.6

SUMMARY

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: None <None>
(cherry picked from commit 8436ad1341)

Co-authored-by: abikouo <79859644+abikouo@users.noreply.github.com>
2021-10-14 10:11:05 -04:00
Mike Graves
70db517265 Copy ignore-2.12.txt to ignore-2.13.txt (#247) (#257)
Copy ignore-2.12.txt to ignore-2.13.txt

SUMMARY
Relates to ansible-collections/overview#45 (comment)

Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
(cherry picked from commit 45ba8b1a0d)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-10-08 14:09:11 -04:00
abikouo
63b84d7f54 kustomize lookup plugin (#225)
kustomize lookup plugin

SUMMARY

new lookup plugin to support kustomize feature for kubernetes

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-09-10 21:02:17 +00:00
abikouo
4b682666f1 k8s - add label_selectors options (#158)
k8s - add label_selectors options

SUMMARY
k8s now support label_selectors options same as k8s_info

Resolves #43

ISSUE TYPE


Feature Pull Request


COMPONENT NAME

k8s

Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-07-29 09:56:34 +00:00
abikouo
f98469e5ef ansible sanity for k8s_cp (#183) 2021-07-27 09:30:24 +05:30
abikouo
c330c7ec65 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>
2021-07-26 13:21:34 +02:00
Abhijeet Kasurde
2f59c3db77 Add exception for import sanity (#177)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-07-21 15:20:25 +02:00
Abhijeet Kasurde
e9be88f212 Add script to handle sanity ignore (#173)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-07-20 15:27:43 +05:30
abikouo
46494a18bd Revert "k8s ability to wait on arbitrary property (#105)" (#133)
This reverts commit 4ccb15d4ad.
2021-06-15 14:32:21 +02:00
abikouo
4ccb15d4ad k8s ability to wait on arbitrary property (#105)
* missing implementation of jsonpath library

* not tested

* sanity

* save

* updates

* Update args_common.py

* lint validation

* fix

* Update k8s.py

* attribute should match for all

* select wait

* Revert "select wait"

This reverts commit a20a1f6f01.

* sanity

* Update molecule/default/tasks/waiter.yml

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update jsonpath_extractor.py

* Update k8s_wait_options.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-15 10:44:26 +02:00
abikouo
481521a09d k8s_scale - add option label_selectors and continue_on_error (#114)
k8s_scale suppport for label selector
2021-06-07 09:57:50 +02:00
abikouo
5bb827f0f4 2.11 sanity on collection (#103)
* sanity 2.11

* add repo name

* repo name syntax

* install requirements

* update ignore

* molecule tests on multiple versions

* Update ci.yml
2021-05-17 15:17:45 +02:00
Mike Graves
01a0815e56 Replace openshift client with kubernetes client (#96)
* Replace openshift client with kubernetes client

This commit primarily just removes mentions of openshift from the docs
and updates the requirements. Most of the work to replace the client has
been done through the following commits:

edc48ee577
c214376cac
48c5170018
2b6a989cf9

* Add changelog fragment

* Update changelogs/fragments/96-replace-openshift-client.yaml

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s_info.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s_service.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Bump minimum kubernetes version to 12.0.0

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-06 14:44:17 -04:00
Mike Graves
2b6a989cf9 Replicate base resource for lists functionality (#89)
* Replicate base resource for lists functionality

This replicates specific functionality from the openshift client to more
reliably retrieve the base resource from a resource list.

* Add changelog fragment
2021-05-05 10:09:22 -04:00
Gonéri Le Bouder
ef6eee26a7 integration: use venv instead of virtualenv (#82)
virtualenv is deprecated since Python3. We use venv instead.
2021-04-23 10:38:08 -04:00
Alina Buzachis
48c5170018 Replicate apply method in the DynamicClient (#45)
* * Replicate apply method in the DynamicClient

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>

* * Add changelog fragment

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
2021-04-22 14:58:53 -04:00
Alina Buzachis
edc48ee577 Add configmap/secret hash functionality (#48)
* * * Add configmap/secret hash functionality

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>

* * Add changelog fragment

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
2021-04-20 08:27:25 -04:00
Mike Graves
ba586a8ed8 Rename from community.kubernetes to kubernetes.core (#6)
* Rename from community.kubernetes to kubernetes.core

This goes through and renames community.kubernetes to kubernetes.core.
Most of this was generated from the downstream build script that was
used on the community repository, plus whatever hand edits I could find
that were needed.

The downstream build and test process has also been removed as this
repository is now the downstream repository.

* Fix CONTRIBUTING.md
2021-04-08 08:48:27 -04:00
Andrew Klychkov
a55edac38f Add ignore.txt for 2.12 (#7) 2021-04-08 14:00:02 +05:30
Mike Graves
d6f251173e Add unit tests to CI (#407)
* Add unit tests to CI

The unit tests were not being run during CI. This adds a GitHub Action
for it.

* Add changelog fragment
2021-04-05 09:39:01 -04:00
Mike Graves
af928a255f Remove old openshift integration tests (#382) 2021-03-16 09:05:52 -04:00
Mike Graves
2640084143 Add optional support for helm diff (#355)
There are some cases where the existing module has difficulty
determining if an upgrade would result in changes. This can particularly
be a problem when changes are made to a local chart.

This adds optional support for helm diff. If the plugin is present it
will be used. Otherwise, the default implementation will be used and a
warning will be issued. One caveat: helm diff does not currently support
using a repo url, so the default implementation will be used in this
case, as well.

Closes: #248
2021-02-03 13:46:26 +05:30
Mike Graves
b26afc3518 Fix Secret check_mode (#343)
When adding a Secret and using stringData, check_mode will always show
changes. An existing resource fetched from Kubernetes will have the
stringData already base64 encoded and merged into the data attribute.
This change performs the base64 encoding and merging with the provided
definition to more accurately represent the current state of the
cluster.

This change only affects check_mode. When making any changes to the
cluster the stringData is passed along as provided in the definition.

Closes #282.
2021-01-14 11:05:11 -05:00
Gonéri Le Bouder
221631c06a helm: add support for the K8S_ envvars (#319)
Add support for:

- K8S_AUTH_HOST
- K8S_AUTH_API_KEY
- K8S_AUTH_VERIFY_SSL
- K8S_AUTH_SSL_CA_CERT

This commit also refactor the way we pass K8S related configuration to `helm`:

All the calls are now done in a new module_utils module (`helm.py`).
The handling of the `kube_*` variables has also been moved in this new
module.

We need https://github.com/helm/helm/pull/8622 to be able to ignore the
certificate validation. As a workaround, the generate a temporary
kubeconfig configuration file.

Closes: #279
2020-12-11 11:41:08 -05:00
Gonéri Le Bouder
befc0f6853 helm and helm_info: adjust the name of two parameters (#324) 2020-12-10 09:28:27 +05:30
Abhijeet Kasurde
4b447cc301 CI fix (#322)
Fixes: #316
2020-12-04 12:33:10 +05:30
Abhijeet Kasurde
4d94cb9439 tests: remove old openshift tests (#311)
Older openshift test cases are no longer valid for this
collection. Removing them for now.

Fixes: #300

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-11-25 11:27:13 -06:00
Gonéri Le Bouder
eff6759660 test: older_openshift_fail.yml fails with py3.7+ (#291)
The `older_openshift_fail.yml` test playbook fails with Python 3.7 because the old `kubernetes.client.apis.admissionregistration_api` module uses the new `async` keyword as a function parameter name. From: https://docs.python.org/3/whatsnew/3.7.html

Backwards incompatible syntax changes:

    `async` and `await` are now reserved keywords.

In this case, we get a `SyntaxError` exception instead of the expected `Failed to import the required Python library (openshift >= 0.7.2)`.
2020-11-10 14:27:23 -05:00
jaydesl
aad4696f20 Fix default configuration getter in client v12.0.0 (#276)
Fixes #273
2020-10-22 15:41:51 -04:00
Adam Miller
d17858c6dd fix downstream ci names
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-08-28 13:58:39 -05:00
Adam Miller
827807392d fix CI tests, helm picked up the same argspec addition as some k8s modules
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-08-27 22:08:01 -05:00
Abhijeet Kasurde
16059a8111 k8s_*: Group argument_spec accroding to usage (#199)
Partially fix #36

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-26 19:48:07 +05:30
Jeff Geerling
881ca3d006 Fixes #145: Use FQCN in module docs and in plugin examples. 2020-06-29 16:25:42 -05:00
Jeff Geerling
c3796da76d Fixes #129: Add 2.11 sanity ignore file. 2020-06-16 15:19:05 -05:00
Örjan Sjöholm
f45d33224f Remove ANSIBLE_METADATA
The meta data field is deprecated and is not used anymore.

See ansible-collections/overview#57 for more details.
2020-05-14 14:25:07 +02:00
Jeff Geerling
7aa071c98f Issue #49: Remaining fixes from diff on auto-migrated collection. 2020-03-20 15:42:13 -05:00
Jeff Geerling
f5c9dcdd29 Use GitHub Action for code coverage reporting. 2020-03-05 09:26:46 -06:00
Jeff Geerling
ac9ee36abb Fixes #44: Fix bare variable deprecation warning by cleaning up unnecessary variable. 2020-03-04 14:22:51 -06:00
Jeff Geerling
eb81891577 Issue #30: Test with Molecule 3.0 alpha. 2020-02-19 11:03:14 -06:00
Jeff Geerling
a75593c36a Attempt to resolve #23 entirely without a json_query(). 2020-02-13 15:47:24 -06:00
Jeff Geerling
b2e639b823 Issue #10: Move integration tests into molecule playbook. 2020-02-13 15:03:47 -06:00
Jeff Geerling
16019872df Issue #21: Put back kubernetes comment to see if coverage gets uploaded. 2020-02-11 17:53:35 -06:00
Jeff Geerling
426cf883ee Remove extra comment in file that was causing bash errors. 2020-02-11 17:22:30 -06:00
Jeff Geerling
41f9aaa5e1 Issue #15: Add code coverage reporting token. 2020-02-11 17:18:42 -06:00
Jeff Geerling
a21f8c4d6b Issue #15: Add codecov coverage reporting like grafana collection. 2020-02-11 17:10:38 -06:00
Jeff Geerling
99dcbcc32f Issue #2: Ignore return-syntax-error for now. 2020-01-30 16:42:22 -06:00
Jeff Geerling
21770a4fe2 Issue #2: Get the rest of the documentation errors fixed. 2020-01-30 16:35:24 -06:00
Jeff Geerling
4ac8e2e8bc Fixes #2: Use correct ignore file naming convention for collection. 2020-01-30 16:14:11 -06:00
Jeff Geerling
48b4c3be54 Issue #2: python_requirements_info is not available in ansible-base. 2020-01-30 14:20:37 -06:00