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

Added functionality for multiple pods and labels #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ChaosInTheCRD
Copy link

I wanted a way to quickly double check / demonstrate the functionality of pod disruption budgets, so I added functionality to specify labels as an argument, e.g.:

kubectl evict-pod --label my-label-key=my-label-value

On top of this, I turned the variable podName into a slice of strings, so you can evicting multiple pods if you wish to, e.g.:

kubectl evict-pod thing-one-6d5bfbb748-7vn6m thing-two-8d93ka03ka-d783m

@ChaosInTheCRD ChaosInTheCRD mentioned this pull request Aug 4, 2021

if len(o.args) > 0 {
o.podName = o.args[0]
if len(args) == 0 {
Copy link
Owner

Choose a reason for hiding this comment

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

will this work for following:

kubectl-evict-pod --label a=b

Copy link
Owner

Choose a reason for hiding this comment

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

in that case len(args) will be 0 right?

@grosser
Copy link
Contributor

grosser commented Aug 2, 2024

taking a stab at making this better ...

@grosser
Copy link
Contributor

grosser commented Aug 2, 2024

#14

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