Bug 1317835 - Update host for route doesn't take effect
Summary: Update host for route doesn't take effect
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Maru Newby
QA Contact: zhaozhanqi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-15 10:25 UTC by Yan Du
Modified: 2022-08-04 22:20 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 16:32:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Origin (Github) 8151 0 None None None 2016-03-19 00:42:07 UTC
Red Hat Product Errata RHSA-2016:1064 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.2 security, bug fix, and enhancement update 2016-05-12 20:19:17 UTC

Description Yan Du 2016-03-15 10:25:10 UTC
Description of problem:
Create a route and try to update the host for route by oc edit route, but the change doesn't take effect after save and quit the edit, and no warning information show up


Version-Release number of selected component (if applicable):
oc v3.2.0.3
kubernetes v1.2.0-origin-41-g91d3e75


How reproducible:
Always


Steps to Reproduce:
1. Create pod/service/route
# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/nginx-pod.json
# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/unsecure/service_unsecure.json
# oc create route edge myroute --service=hello-nginx --hostname=www.edge.com
# oc get route
NAME      HOST/PORT      PATH      SERVICE            TERMINATION   LABELS
myroute   www.edge.com             hello-nginx:http   edge          name=hello-nginx

2. Try to update the host for route, eg change www.edge.com to www.edge1.com
# oc edit route myroute
 
3. Check the route


Actual results:
The change for route doesn't take effect
step3: The route is still same
# oc get route
NAME      HOST/PORT      PATH      SERVICE            TERMINATION   LABELS
myroute   www.edge.com             hello-nginx:http   edge          name=hello-nginx



Expected results:
The host could be updated successfully. If the host is not allowed to change, at least some friendly warnings show up



Additional info:
The route after updating 

# oc get route -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: Route
  metadata:
    creationTimestamp: 2016-03-15T10:04:57Z
    labels:
      name: hello-nginx
    name: myroute
    namespace: d2
    resourceVersion: "2493"
    selfLink: /oapi/v1/namespaces/d2/routes/myroute
    uid: 5f3cc539-ea95-11e5-bb44-fa163ec44b15
  spec:
    host: www.edge1.com
    port:
      targetPort: http
    tls:
      termination: edge
    to:
      kind: Service
      name: hello-nginx
  status:
    ingress:
    - conditions:
      - lastTransitionTime: 2016-03-15T10:04:58Z
        status: "True"
        type: Admitted
      host: www.edge.com
      routerName: router
kind: List
metadata: {}

Comment 1 Maru Newby 2016-03-17 15:15:05 UTC
I can reproduce.  The edit to the route is successful, and the router picks up the edit and reconfigures itself for the new hostname.  However, 'oc get route' prefers the host of the ingress status which is not being updated when the host of a route changes.

Comment 2 Maru Newby 2016-03-18 16:46:23 UTC
I have a partial diagnosis.  

When the status plugin encounters a route for the first time it writes the update time to its timestamp cache with nanosecond precision, but the ingress timestamp is not stored with nanosecond precision.  When the host for the route is subsequently updated, the status plugin finds the most recent ingress timestamp to not match its cached timestamp and, assuming this to mean that another route has updated the ingress status, does not update the ingress status for the route with the updated host.

Bouncing the router pod with 'oc dc router --latest' clears the router's timestamp cache and all subsequent router updates are correctly handled by the status plugin.

I'm assuming the fix is truncating the nanosecond portion of timestamps before they are stored in the status plugin's timestamp cache, but need to confirm this.

Comment 3 Maru Newby 2016-03-23 03:38:37 UTC
The origin PR has merged.

Comment 4 Troy Dawson 2016-03-28 18:47:29 UTC
This has been merged into OSE and is in release v3.2.0.8

Comment 5 Yan Du 2016-03-29 07:14:31 UTC
Test on latest ose env

openshift v3.2.0.8
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5


Issue have been fixed, route could be updated successfully, move bug to verified

Comment 7 errata-xmlrpc 2016-05-12 16:32:54 UTC
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/RHSA-2016:1064


Note You need to log in before you can comment on or make changes to this bug.