Description of problem: When using 'ALL' option. eg. './clear-route-status.sh default ALL',it cannot clean the routes status when there are more than 2 routes Version-Release number of selected component (if applicable): openshift v3.5.0.37 kubernetes v1.5.2+43a9be4 etcd 3.1.0 How reproducible: always Steps to Reproduce: 1. Create two router oadm router router1 oadm router router2 2. Create some route test1 test2 3. delete the router2 oc delete dc router2 4. get the script wget https://raw.githubusercontent.com/openshift/origin/master/images/router/clear-route-status.sh 5. Clean all routes status 'router2' ./clear-route-status.sh default ALL 6. Check the route stauts 'router2' if has been delted. oc get route -o json | grep router2 Actual results: the status of routerName 'router2' still exist in all routes Expected results: router2 should be deleted for all routes Additional info:
origin PR: https://github.com/openshift/origin/pull/13246
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/edef4d133bcaf5c06668c12252122b2800c2df09 correct the ways that routes are iterated over to be cleared there was an oversight in the way that the clear route status iterated over the routes returned by oc get routes -o jsonpath='{.items[*].metadata.name}' --namespace="${namespace}" 2>/dev/null currently all routes are presented as one string that the server cannot find. Changed that so that the routes are returned into an array and correctly iterated over so that the server is given one route name at a time Bug 1429364 Bug 1429398
Test on latest OCP env V3.5.0.52 with the latest script in https://github.com/openshift/origin/pull/13246 Multiple routes in one project could be cleared normally by the script. but after the clear operation, the time of "exposed on router router1 5 minutes ago" have been changed. Before clear: exposed on router router1 5 minutes ago $ oc describe route route1 -n d1 Name: route1 Namespace: d1 Created: 6 minutes ago Labels: name=service-unsecure Annotations: openshift.io/host.generated=true Requested Host: route1-d1.0313-vn8.qe.rhcloud.com exposed on router router 6 minutes ago exposed on router router1 5 minutes ago <========= $ ./clear-route-status.sh d1 ALL route status for route route1 in namespace d1 cleared route status for route route2 in namespace d1 cleared route status for route route3 in namespace d1 cleared After clear: exposed on router router1 11 seconds ago $ oc describe route route1 -n d1 Name: route1 Namespace: d1 Created: 7 minutes ago Labels: name=service-unsecure Annotations: openshift.io/host.generated=true Requested Host: route1-d1.0313-vn8.qe.rhcloud.com exposed on router router1 11 seconds ago <=========
https://github.com/openshift/origin/issues/13246
Yan Du this is expected behaviour, the user is clearing all route statuses and the router has to rewrite it. When writing the status the field retains no state.
This has been merged into ocp and is in OCP v3.6.27 or newer.
Test on latest OCP env, multiple routes in one project could be cleared normally. oc v3.6.27 kubernetes v1.5.2+43a9be4 # ./clear-route-status.sh d1 ALL route status for route route1 in namespace d1 cleared route status for route route2 in namespace d1 cleared route status for route route3 in namespace d1 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