-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: don't try to use shutdown gateways #116
Conversation
When gateway pods are evicted, they stay around with status "Shutdown". We need to filter for running pods to get a gateway that we can actually use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @oleschoenburg :) Please check the quoating stuff again. You could also try it locally. If your source the util.sh
(source utils.sh
) can call the functions you will see what I mean.
@@ -38,7 +38,7 @@ function runOnAllBrokers() | |||
{ | |||
namespace=$(getNamespace) | |||
|
|||
pods=$(kubectl get pod -n "$namespace" $(getBrokerLabels) -o jsonpath="{.items[*].metadata.name}") | |||
pods=$(kubectl get pod -n "$namespace" "$(getBrokerLabels)" -o jsonpath="{.items[*].metadata.name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ this quoating doesn't work here. We want to have multiple labels here, splitted. Either we ignore this shellcheck error or we implement this differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, of course 🤦 I'll add an ignore instead.
|
||
echo "$pod" | ||
} | ||
|
||
function getGateway() | ||
{ | ||
namespace=$(getNamespace) | ||
pod=$(kubectl get pod -n "$namespace" $(getGatewayLabels) -o jsonpath="{.items[0].metadata.name}") | ||
pod=$(kubectl get pod -n "$namespace" --field-selector status.phase=Running "$(getGatewayLabels)" -o jsonpath="{.items[0].metadata.name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 👍
labels actually need to be split on whitespace, so we disable the shellcheck instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎖️
When gateway pods are evicted, they stay around with status "Shutdown".
We need to filter for running pods to get a gateway that we can actually use.