Description of problem: clear-route-status.sh can not clean the route stale status field by using '-r' option Version-Release number of selected component (if applicable): openshift v3.5.0.39 kubernetes v1.5.2+43a9be4 How reproducible: always Steps to Reproduce: 1. Create router 2. Create some routes 3. Delete the old router and recreate a new router named router1 4. Clear the status set by a specific router $ wget https://raw.githubusercontent.com/openshift/origin/master/images/router/clear-route-status.sh $ ./clear-route-status.sh -r router Actual results: $ ./clear-route-status.sh -r router Error from server (NotFound): routes "docker-registry registry-console" not found Expected results: Should not show route could not found, since the routes are existed, and the status fields for old router could be cleared. # oc describe route docker-registry Name: docker-registry Namespace: default Created: 31 hours ago Labels: <none> Annotations: openshift.io/host.generated=true Requested Host: docker-registry-default.0305-mnr.qe.rhcloud.com exposed on router router 31 hours ago exposed on router router1 17 minutes ago
origin PR: https://github.com/openshift/origin/pull/13246
Test on latest OCP env V3.5.0.52 with the latest script in https://github.com/openshift/origin/pull/13246 Seem the -r option is still not working: $ ./clear-route-status.sh -r router1 error: index is not defined .status.ingress | map(.routerName != "router1") | index(false) ^^^^^ 1 compile error
https://github.com/openshift/origin/issues/13246
I can't reproduce the error that you see with the clear route script could you be more specific?
https://github.com/openshift/origin/pull/13678 removed the call to index could you retest?
Retest with the script in https://github.com/openshift/origin/pull/13678, got below error: [root@host-8-174-54 ~]# ./clear-route-status.sh -r router error: syntax error, unexpected QQSTRING_START, expecting $end ."status"."ingress"|=map(select(.routerName != "router")) ^ 1 compile error
The script in https://github.com/openshift/origin/pull/13678 could not work normally and get the error as #comment 8
@Yan Du: Can you run: jq --version Thanks
# jq --version jq version 1.3
After using jq 1.5 for test, the script could work well. # ./clear-route-status.sh -r router route status for route route1 set by router router cleared route status for route route2 set by router router cleared route status for route route3 set by router router cleared route status for route route4 set by router router cleared route status for route route5 set by router router cleared route status for route docker-registry set by router router cleared route status for route registry-console set by router router cleared route status for route cakephp-mysql-example set by router router cleared No routes found for namespace kube-system No routes found for namespace logging No routes found for namespace management-infra No routes found for namespace openshift No routes found for namespace openshift-infra
yan since this past your test could you move this forward?
@jtanenba Sure, but could you please kindly move to bug status to ON_QA, then I could move it to verified.
@jtanenba One more question, do we need to mention that the script only works with version jq >= 1.4 in documentation warning message in script?
How did you upgrade jq? What version of RHEL did 1.3 ship with?
I am using rhel 7.2, and I just upgrade jq by downloading a binary from https://stedolan.github.io/jq/download/
The jq package from epel-7 repo is version 1.5-1 And seems it is not available in rhel-7-server-rpms and rhel-7-server-extras-rpms
The command with -r option actually need to be ran on master with cluster-admin, but actually there is no jq installed by default on master. So do we plan to have jq installed by default on master?
Ok, given what Meng Bo and Yan Du have found (thank you both, by the way!) I think we need to amend the checks around https://github.com/JacobTanenbaum/origin/blob/eb5f10682ea72f54fec0b7714ede032d273f3182/images/router/clear-route-status.sh#L86 to check for a minimum version too... and we should state the version needed in the message that tells people what to install.
Although, in the interests of not going mad doing version parsing, perhaps we ought to do feature detection and add a line like: echo '' | jq '."status"."ingress"|=map(select(.routerName != "test"))' And make sure that $? is 0. If not, then we can tell them they need at least version 1.4.
Origin PR: https://github.com/openshift/origin/pull/14200
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/866f8bbfadc082a18e5a0d3bbe9dfd0e0c56bbe2 Change version check on jq in clear route status script jq is required for the JSON processing required for clearing the route status. During QA it was found that the version of jq has to be greater than 1.4. Expand the check on jq for the capabilities needed and the message to include the version number Bug 1429398
Test on latest OCP-3.6 env openshift v3.6.86 kubernetes v1.6.1+5115d708d7 [root@ip-172-18-4-211 ~]# ./clear-route-status.sh -r router Command line JSON processor 'jq' not found. please install 'jq' version greater than 1.4 to use this script. [root@ip-172-18-4-211 ~]# jq --version jq version 1.3 [root@ip-172-18-4-211 ~]# ./clear-route-status.sh -r router Command line JSON processor 'jq' version is incorrect. Please install 'jq' version greater than 1.4 to use this script [root@ip-172-18-4-211 ~]# jq --version jq-1.5 [root@ip-172-18-4-211 ~]# ./clear-route-status.sh -r router No routes found for namespace d1 No routes found for namespace d2 route status for route test-service set by router router cleared route status for route docker-registry set by router router cleared route status for route registry-console set by router router cleared route status for route cakephp-mysql-example set by router router cleared
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2017:1716