Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to specify a custom condition when waiting #52185

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

fabianvf
Copy link
Contributor

SUMMARY

This allows users to specify a custom condition to wait for when using the k8s module. This provides a similar functionality to the kubectl wait command. This is one option, I'm working on another option right now which is a specify k8s_wait module that allows some more flexibility and keeps the k8s module slimmer.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

k8s

@ansibot
Copy link
Contributor

ansibot commented Feb 13, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. k8s module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Feb 13, 2019
@willthames
Copy link
Contributor

This is pretty nice. I was skeptical, as my feelings are that you could easily do this with k8s_facts and retries but this is significantly more elegant than that, and reuses existing functionality.

Does this need to work with nested keys? (I have no idea if it needs to, looks like most status keys are top level)

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Feb 14, 2019
@fabianvf fabianvf mentioned this pull request Feb 14, 2019
@fabianvf
Copy link
Contributor Author

In its current state, this will only work with conditions, not top-level fields (I focused on conditions because they're a bit hellish to parse, especially in Ansible). The k8s_wait module in #52274 supports comparison on arbitrary fields, but feels wrong. Still thinking about different ways to do this.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Feb 22, 2019
@fabianvf
Copy link
Contributor Author

fabianvf commented Mar 4, 2019

ping @willthames, look good to you? I'd like to get this in for 2.8 if possible

@ansibot ansibot added the clustering Clustering category label Mar 4, 2019
@maxamillion
Copy link
Contributor

shipit

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Mar 4, 2019
@fabianvf
Copy link
Contributor Author

fabianvf commented Mar 5, 2019

bot_status

@ansibot
Copy link
Contributor

ansibot commented Mar 5, 2019

Components

lib/ansible/module_utils/k8s/raw.py
support: community
maintainers: chouseknecht fabianvf flaper87 maxamillion willthames

lib/ansible/modules/clustering/k8s/k8s.py
support: community
maintainers: chouseknecht fabianvf flaper87 maxamillion willthames

test/integration/targets/k8s/playbooks/roles/k8s/tasks/waiter.yml
support: community
maintainers: chouseknecht fabianvf flaper87 maxamillion willthames

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 1
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 1
shipit_actors (maintainers or core team members): maxamillion fabianvf
shipit_actors_other: []
automerge: automerge !module file(s) test failed

click here for bot help

@gundalow gundalow merged commit 65424dd into ansible:devel Mar 6, 2019
@gundalow
Copy link
Contributor

gundalow commented Mar 6, 2019

Thanks all, merged into devel for release in Ansible 2.8

As long as label/shipit is added we get these merged within the week. #52185 (comment)

@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 clustering Clustering category feature This issue/PR relates to a feature request. k8s module This issue/PR relates to a module. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants