Bug 1429398
Summary: | clear-route-status.sh can not clean the route stale status field by using '-r' option | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Yan Du <yadu> |
Component: | Networking | Assignee: | Jacob Tanenbaum <jtanenba> |
Networking sub component: | router | QA Contact: | zhaozhanqi <zzhao> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | medium | ||
Priority: | medium | CC: | aos-bugs, bbennett, bmeng, eparis, jtanenba, smunilla, yadu, zzhao |
Version: | 3.5.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Cause:
The script does not check the version of jq and does not populate its array of routes correctly
Consequence:
When using the -r the script failes
Fix:
Check to makes sure the user has an appropriate version of jq and populate the array of target routes properly
Result:
The script correctly clears the routes specified of status messages
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-10 05:18:47 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Yan Du
2017-03-06 09:58:59 UTC
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 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. 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 |