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
Fixes#68
Rather than relying on the default serialization logic (which attempts
to parse a log as JSON and then load it into a wrapper class), we
now simply return the raw log data as expected. The previous behavior
worked in many cases because the log was serialized into a JSON string,
but in the case of #68 the log was loaded as a JSON float, which
made the error handling fail to fallback to returning the raw
data.
When the ansible k8s module is refreshing the tokens from the local kube
config, it should save those token to the kube config file.
If this is not done, this might break the next kube client call as the
token in the local kube config file is not valid anymore and refreshing
can fail.
This commit is adding an env var K8S_AUTH_PERSIST_CONFIG that can be
used to set this flag to true (default is false, same as current
behavior).