Skip to content

correct the ways that routes are iterated over to be cleared #13246

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

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions images/router/clear-route-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function clear_status_set_by() {
local router_name="${1}"

for namespace in $( oc get namespaces -o 'jsonpath={.items[*].metadata.name}' ); do
local routes; routes=$(oc get routes -o jsonpath='{.items[*].metadata.name}' --namespace="${namespace}" 2>/dev/null)
if [[ -n "${routes}" ]]; then
for route in "${routes}"; do
local routes; routes=($(oc get routes -o jsonpath='{.items[*].metadata.name}' --namespace="${namespace}" 2>/dev/null))
if [[ "${#routes[@]}" -ne 0 ]]; then
for route in "${routes[@]}"; do
clear_routers_status "${namespace}" "${route}" "${router_name}"
done
else
Expand Down Expand Up @@ -106,9 +106,9 @@ namespace="${1}"
route_name="${2}"

if [[ "${route_name}" == "ALL" ]]; then
routes=$(oc get routes -o jsonpath='{.items[*].metadata.name}' --namespace="${namespace}" 2>/dev/null)
if [[ -n "${routes}" ]]; then
for route in "${routes}"; do
routes=($(oc get routes -o jsonpath='{.items[*].metadata.name}' --namespace="${namespace}" 2>/dev/null))
if [[ "${#routes[@]}" -ne 0 ]]; then
for route in "${routes[@]}"; do
clear_status "${namespace}" "${route}"
done
else
Expand Down