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

Make k8s_drain work when only one pod is present #770

Merged

Conversation

OttaviaB
Copy link
Contributor

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

Copy link

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.

Thank you for the PR.

@gravesm gravesm added the mergeit label Nov 1, 2024
Copy link

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

✔️ ansible-galaxy-importer SUCCESS in 3m 47s
✔️ build-ansible-collection SUCCESS in 5m 32s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 4c305e7 into ansible-collections:main Nov 1, 2024
6 checks passed
@yurnov yurnov mentioned this pull request Dec 10, 2024
30 tasks
Copy link

patchback bot commented Dec 11, 2024

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/4c305e73f0a5785752de0af5189acd4dd537e198/pr-770

Backported as #820

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link

patchback bot commented Dec 11, 2024

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/4c305e73f0a5785752de0af5189acd4dd537e198/pr-770

Backported as #821

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 11, 2024
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)
patchback bot pushed a commit that referenced this pull request Dec 11, 2024
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)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request 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
softwarefactory-project-zuul bot pushed a commit that referenced this pull request 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k8s_drain not waiting for pod deletion if there is only one pod to evict
2 participants