[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>
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>
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>
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>
* 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:
edc48ee577c214376cac48c51700182b6a989cf9
* 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>
* 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
* 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
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
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.
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
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>
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)`.