[backport/2.2] Remove distutils from connection plugin (#456)
Remove distutils from connection plugin
SUMMARY
distutils.spawn.find_executable is deprecated and shutils.which is a
suitable replacement.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Gonéri Le Bouder goneri@lebouder.net
Reviewed-by: Joseph Torcasso
(cherry picked from commit 531a9fe)
SUMMARY
ISSUE TYPE
Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
[backport/2.2] Prepare for distutils.version being removed in Python 3.12 (#314)
Prepare for distutils.version being removed in Python 3.12
SUMMARY
distutils has been deprecafed and will be removed from
Python's stdlib in Python 3.12 (see python.org/dev/peps/pep-0632).
This PR replaces the use of distutils.version.LooseVersion and distutils.version.StrictVersion
with LooseVersion from the vendored copy of distutils.version
included with ansible-core 2.12 (ansible/ansible#74644) if available,
and falls back to distutils.version for ansible-core 2.11 and before.
Since ansible-core 2.11 and earlier do not support Python 3.12 (since
they use LooseVersion itself in various places), this incomplete fix
should be OK for now. Also, the way this PR works (by adding a new
module_utils version that abstracts away where LooseVersion comes from),
it is easy to also fix this for ansible-core 2.11 and earlier later on.
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
changelogs/fragments/disutils.version.yml
molecule/default/roles/helm/library/helm_test_version.py
plugins/module_utils/common.py
plugins/module_utils/version.py
plugins/modules/helm.py
Reviewed-by: Felix Fontein felix@fontein.de
Reviewed-by: Mike Graves mgraves@redhat.com
Reviewed-by: None
(cherry picked from commit ed33d0b)
SUMMARY
ISSUE TYPE
Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
[backport/2.2] Fix validation errors in plugin documentation (#399)
Fix validation errors in plugin documentation
SUMMARY
This fixes validation errors in plugin documentation now that ansible
test for 2.13 is running validate-modules on all plugins. The kubectl
connection plugin validation is ignored because there seems to be a
requirement for the author field to have a github username, which we do
not have.
ISSUE TYPE
Docs Pull Request
COMPONENT NAME
plugins/connection/kubectl
plugins/inventory/k8s
plugins/lookup/k8s
plugins/lookup/kustomize
ADDITIONAL INFORMATION
Reviewed-by: None
(cherry picked from commit 30e84fa)
[backport/2.2] Move integration test suite from molecule to ansible-test (#392)
Move integration test suite from molecule to ansible-test
SUMMARY
molecule has been replaced with ansible-test
some test cases have been updated
k8s_apply : remove duplicated tasks increasing the running time of the test
helm: use different namespaces for different test cases in order to wait for the namespace deletion before moving to the next test.
all: remove wait: yes at the end of each test when deleting namespace, the role used to create namespace will ensure that it is deleted before if existing.
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
integration testing
Reviewed-by: Mike Graves mgraves@redhat.com
Reviewed-by: Gonéri Le Bouder goneri@lebouder.net
Reviewed-by: None
(cherry picked from commit fd61f8b)
SUMMARY
ISSUE TYPE
Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Add integration test to check handling of module_defaults
SUMMARY
Add integration test to make sure that module_defaults are handled correctly in tasks.
Related to #126.
ISSUE TYPE
Bugfix Pull Request
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
(cherry picked from commit 79699ba429)
Co-authored-by: Mandar Kulkarni <mandar242@gmail.com>
[backport/2.2] Remove binary file from molecule test suite
SUMMARY
The binary file used to test k8s_cp is causing larger problems
downstream. There's no reason why the binary file needs to function as
all we care about is that the content of the file has not changed during
the copy process. This can be accomplished by comparing file hashes.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Abhijeet Kasurde
Reviewed-by: None
(cherry picked from commit fa65698)
Reviewed-by: None <None>
[backport/2.2] common/_wait_for: ensure label_selectors is optional (#239)
Depends-On: ansible/ansible-zuul-jobs#1170
Depends-On: ansible/ansible-zuul-jobs#1169
Depends-On: ansible/ansible-zuul-jobs#1171
common/_wait_for: ensure label_selectors is optional
The label_selectors is a new parameter for _wait_for that was
introduced in #158.
The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.
Reviewed-by: None
Reviewed-by: Alina Buzachis
Reviewed-by: None
(cherry picked from commit 938f7e1)
Reviewed-by: None <None>
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
[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>
Remove molecule dependencies
SUMMARY
Depends-on: ansible-collections/cloud.common#92
Molecule is overwriting the cloud.common dependency installed by zuul,
which is causing issues with the CI job for turbo mode. We still need to
find a way to test against the latest released version of cloud.common.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
(cherry picked from commit ff43353de6)
fix k8s_cp uploading when deployed container's WORKDIR is other than '/'
SUMMARY
fix#222
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
k8s_cp
ADDITIONAL INFORMATION
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
Reviewed-by: None <None>
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>
Fix resource cache not being used
SUMMARY
This was some bad copy/paste from the openshift client. The resource
cache was never being used resulting in unnecessary HTTP requests.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: None <None>
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
Minor doc fix turbo mode
SUMMARY
Minor doc fix
ISSUE TYPE
Docs Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
Disable turbo mode for the validate tests
Depends-On: ansible/ansible-zuul-jobs#1074
Switching virtualenvs in the test suite does not work so well with turbo
mode enabled because the module may not be executed by the virtualenv
that is specified for that task.
Reviewed-by: None <None>
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
add support for in-memory kubeconfig
SUMMARY
k8s module support now authentication with kubeconfig parameter as file and dict.
Closes#139
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
Test molecule on ansible release 2.9 and 2.10
SUMMARY
Debug only
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: None <None>
Move integration tests to molecule
SUMMARY
There are only a handful of integration tests in tests/integration.
These are presumably left over from before the collection used molecule.
The only integration tests that aren't already covered by molecule are
the ones testing kubernetes-validate. I have moved these tests into
molecule so we can delete the integration test job.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: None <None>
Reviewed-by: None <None>
Re-enable support for turbo mode
SUMMARY
This re-enables the ability to add turbo mode. It also adds a few more
tests to cover some cases that had been broken in turbo mode previously.
Testing with turbo mode is not currently enabled, and would fail until ansible-collections/cloud.common#69 can be merged and a new cloud.common release is done. This also does not add cloud.common to the collection dependencies until a decision has been made about how enabling/disabling turbo mode will work when cloud.common is already installed.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
Fix network_sanity_ee_tests
SUMMARY
Network sanity ee tests are broken
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
k8s_drain new module
SUMMARY
new module to drain, cordon or uncordon node from k8s cluster.
#141
ISSUE TYPE
New Module Pull Request
COMPONENT NAME
k8s_drain
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
[connection plugin] add missing information from censored command
SUMMARY
when running playbook with vvv option, the censored command display is not reflecting the execution
ISSUE TYPE
Bugfix Pull Request
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
Add support for waiting on a StatefulSet.
SUMMARY
This PR implements support for waiting on StatefulSet for readiness similar to how the other waiters currently work.
ISSUE TYPE
Feature Pull Request
ADDITIONAL INFORMATION
This was designed to (mostly) mimic the behaviour of the StatefulSetStatusViewer used by kubectl rollout status -w.
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Joshua K <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>
* support diff mode for k8s module
* Update and rename 145-k8s-add-support-diff-mode.yml to 146-k8s-add-support-diff-mode.yml
* Update 146-k8s-add-support-diff-mode.yml
* Update changelogs/fragments/146-k8s-add-support-diff-mode.yml
Co-authored-by: Mike Graves <mgraves@redhat.com>
* update k8s_scale and k8s_json_patch
* diff for k8s_scale and k8s_json_patch
Co-authored-by: Mike Graves <mgraves@redhat.com>
* helm: add support for history-max parameter
The --history-max parameter allows the user to set a maximum amount of
revisions per release to be kept in the history.
By default helm keeps 10 revisions per release, which means that 10
secrets will be kept per release.
* helm: remove default for history_max
When the history_max option is not set, the module will not pass
'--history-max' to the CLI command. This ensures that the defaults of
the helm CLI will alwasy be used.
* helm: remove whitespace trail
* helm: add mutually exclusive logic
The 'history_max' parameter is not available when using the 'helm
install' command, it is only implemented for 'helm ugprade'.
The 'replace' option uses the 'install' parameter, thus 'replace' and
'history_max' have to be mutually exclusive.
* helm: formatting changes