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

molecule gc.yml - fix sporadic fail #144

Merged
merged 2 commits into from
Jun 24, 2021

Conversation

abikouo
Copy link
Contributor

@abikouo abikouo commented Jun 22, 2021

SUMMARY

Improve #132

@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

Merging #144 (6945cd4) into main (2eca446) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #144   +/-   ##
=======================================
  Coverage   24.02%   24.02%           
=======================================
  Files           1        1           
  Lines         154      154           
  Branches       29       29           
=======================================
  Hits           37       37           
- Misses        111      112    +1     
+ Partials        6        5    -1     
Impacted Files Coverage Δ
...ections/kubernetes/core/plugins/action/k8s_info.py 24.02% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eca446...6945cd4. Read the comment docs.

Copy link
Member

@gravesm gravesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the until fix not work?

@Akasurde
Copy link
Member

Does the until fix not work?

I guess no. Since it is not able to find status in resource[0]

@abikouo
Copy link
Contributor Author

abikouo commented Jun 23, 2021

Does the until fix not work?

I guess no. Since it is not able to find status in resource[0]

indeed seems not enough, and we cannot add a wait condition for Job resource type as the API does not return information on Pods statuses.

@Akasurde
Copy link
Member

@abikouo Do you know any other predictive way by which we can remove the hardcoded sleep value?

@gravesm
Copy link
Member

gravesm commented Jun 23, 2021

How about instead of waiting until the pod is running we first just wait until there is a pod. At that point we have the pod name and can easily just wait until the pod is running. Something like:

- kubernetes.core.k8s_info:
    kind: Pod
    namespace: "{{ ns }}"
    label_selector:
      - "job=gc"
  register: job
  until: job.resources
  retries: 5
  delay: 10

- kubernetes.core.k8s_info:
    kind: Pod
    namespace: "{{ ns }}"
    name: "{{ job.resources[0].metadata.name }}"
    wait: yes

@Akasurde
Copy link
Member

Make sense to me.

Copy link
Member

@gravesm gravesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will be glad to have this fixed. 🎉

@abikouo abikouo changed the title molecule gc.yml - fix sporadic wait molecule gc.yml - fix sporadic fail Jun 24, 2021
@abikouo abikouo merged commit 35af8a4 into ansible-collections:main Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants