* Make an AnsibleMixin parent class for every module
* Replace KubernetesAnsibleModule class with dummy class
* Modified k8s_log
* k8s_exec refactor
* k8s_info refactor
* k8s_service refactor
* k8s_scale refactor
* Fix integration tests
* Add a warning about the deprecation of KubernetesAnsibleModule
* Add a dummy class for backward compatibility
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
When the diff contains changes only to the fields `metadata.generation`
or `metadata.resourceVersion`, do not mark the task as changed. Instead,
emit a warning highlighting that the API itself may not be
idempotent, but that there was no meaningful difference between the
desired and actual state of the resource.
kind can be provided by number of ways. It is diffcult to
find all cases. So, handle exceptions raised by underlying
APIs and provide good error message to user.
Fixes: ansible/ansible#63652
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
check_mode with wait updates the result based on the existing resource
which won't change with check_mode, so returns incorrect results.
Only run the wait checks in non check_mode (this also avoids the issue
of waiting for resource creation that will never happen in check mode)
Any kubernetes manifest file ending with '---' will
generate an error when applied using 'k8s' module.
Although this may not be 'legal' YAML, this is quite frequent,
specially on helm's generated manifest files.
migrated from https://github.com/ansible/ansible/pull/59160
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
helm command provides option to remove installation on failure using
'atomic' flag.
This fix adds this parameter in helm module.
Fixes: #109
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Provide message to user about invalid or empty kubeconfig
by handling exception raised by kubernetes Python API
Fixes: #90
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Use information from strategic merges to improve
the quality of diffs, particularly for list items
(order no longer important, and adding/removing an
item from a list just shows that item in the diff,
not the whole list)
Move wait logic out of raw and into common and use that
logic in scale
Fix a few broken wait condition cases highlighted by scaling
up and down
Move scale-related tests into dedicated test task file
Additional service related tests
Documenting the structure of the dictionary to pass in needs to be done
via suboptions rather than putting the structure directoly inside of the
toplevel option.
Ensure that Deployments and Daemonsets properly await
all replicas to be available. Correctly handles the
subtle edge case when a service account no longer exists.
Note that this will dramatically slow Daemonset updates