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

[PR #770/4c305e73 backport][stable-3] Make k8s_drain work when only one pod is present #821

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Dec 11, 2024

This is a backport of PR #770 as merged into main (4c305e7).

SUMMARY

Fixes #769 .

k8s_drain was not checking if a pod has been deleted when there was only one pod on the node to be drained.

The list of pods, pods, was being "popped" before the first iteration of the while loop:

        pod = pods.pop()
        while (_elapsed_time() < wait_timeout or wait_timeout == 0) and pods:

When pods contains only one element, the while loop is skipped.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

k8s_drain

SUMMARY
Fixes #769 .
k8s_drain was not checking if a pod has been deleted when there was only one pod on the node to be drained.
The list of pods, pods, was being "popped" before the first iteration of the while loop:
        pod = pods.pop()
        while (_elapsed_time() < wait_timeout or wait_timeout == 0) and pods:
When pods contains only one element, the while loop is skipped.

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

k8s_drain

Reviewed-by: Mike Graves <[email protected]>
(cherry picked from commit 4c305e7)
Copy link

Copy link

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/4ae37989a97f4a65b0e3f484711d9b57

✔️ ansible-galaxy-importer SUCCESS in 3m 00s
✔️ build-ansible-collection SUCCESS in 6m 39s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit ee9939c into stable-3 Dec 11, 2024
47 checks passed
@gravesm gravesm deleted the patchback/backports/stable-3/4c305e73f0a5785752de0af5189acd4dd537e198/pr-770 branch December 11, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants