-
Notifications
You must be signed in to change notification settings - Fork 26
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
No err message on node found #164
base: master
Are you sure you want to change the base?
Conversation
hacks/ops-pod
Outdated
@@ -111,7 +111,7 @@ if [[ -n ${node_of_pod} ]]; then | |||
else | |||
echo "Node name provided ..." | |||
# shellcheck disable=SC2076 |
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 should no-longer be necessary: https://www.shellcheck.net/wiki/SC2076
@@ -111,7 +111,7 @@ if [[ -n ${node_of_pod} ]]; then | |||
else | |||
echo "Node name provided ..." | |||
# shellcheck disable=SC2076 | |||
if [[ $(kubectl get nodes -o jsonpath='{.items[*].metadata.name}') =~ " ${node} " ]]; then | |||
if kubectl get nodes -o jsonpath='{.items[*].metadata.name}' | grep -q "\b${node}\b"; then | |||
echo -e "Deploying ops pod on ${node}\n" | |||
else | |||
echo -e "Error: node ${node} does not exist in the cluster.\n" |
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.
Can we use this PR to also add an exit 1
after the print_usage
call so that we do not try to start up a pod that will never become Ready
since the node does not exist?
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.
Actaully, should print_usage
also exit?
What this PR does / why we need it:
PR fixes the case where a node is found but err message is still printed in
hacks/ops-pod
.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: