mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 13:02:37 +00:00
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>
This commit is contained in:
@@ -252,6 +252,32 @@ EXAMPLES = r'''
|
||||
status: Unknown
|
||||
reason: DeploymentPaused
|
||||
|
||||
# Wait for this service to have acquired an External IP
|
||||
- name: Create ingress and wait for ip to be assigned
|
||||
kubernetes.core.k8s:
|
||||
template: dash-service.yaml
|
||||
wait: yes
|
||||
wait_property:
|
||||
property: status.loadBalancer.ingress[*].ip
|
||||
|
||||
# Wait for container inside a pod to be ready
|
||||
- name: Create Pod and wait for containers to be ready
|
||||
kubernetes.core.k8s:
|
||||
template: pod.yaml
|
||||
wait: yes
|
||||
wait_property:
|
||||
property: status.containerStatuses[*].ready
|
||||
value: "true"
|
||||
|
||||
# Wait for first container inside a pod to be ready
|
||||
- name: Create Pod and wait for first containers to be ready
|
||||
kubernetes.core.k8s:
|
||||
template: pod.yaml
|
||||
wait: yes
|
||||
wait_property:
|
||||
property: status.containerStatuses[0].ready
|
||||
value: "true"
|
||||
|
||||
# Patch existing namespace : add label
|
||||
- name: add label to existing namespace
|
||||
kubernetes.core.k8s:
|
||||
|
||||
@@ -164,6 +164,7 @@ def execute_module(module, k8s_ansible_mixin):
|
||||
wait_sleep=module.params["wait_sleep"],
|
||||
wait_timeout=module.params["wait_timeout"],
|
||||
condition=module.params["wait_condition"],
|
||||
property=module.params["wait_property"]
|
||||
)
|
||||
module.exit_json(changed=False, **facts)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user