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

fix: don't try to use shutdown gateways #116

Merged
merged 3 commits into from
Feb 22, 2022

Conversation

lenaschoenburg
Copy link
Member

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.

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.
Copy link
Member

@ChrisKujawa ChrisKujawa left a 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}")
Copy link
Member

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.

Copy link
Member Author

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}")
Copy link
Member

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.
Copy link
Member

@ChrisKujawa ChrisKujawa left a comment

Choose a reason for hiding this comment

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

🎖️

@lenaschoenburg lenaschoenburg merged commit c664995 into master Feb 22, 2022
@lenaschoenburg lenaschoenburg deleted the use-running-gateways-only branch February 22, 2022 10:10
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.

2 participants