Bug 1391878

Summary: [networking_public_222]The later host name should mark as 'HostAlreadyClaimed' when creating two same wildcard route
Product: OpenShift Container Platform Reporter: zhaozhanqi <zzhao>
Component: NetworkingAssignee: Ram Ranganathan <ramr>
Networking sub component: router QA Contact: zhaozhanqi <zzhao>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, bbennett, tdawson
Version: 3.4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-18 12:49: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 zhaozhanqi 2016-11-04 09:58:50 UTC
Description of problem:
When creating two wildcard route
test1.example.com to service1
test2.example.com to service2
actually, both two route will be mapping '*.example.com'. whatever access test1.example.com or test2.example.com. both two will be route to service1. so we should mark the later one to 'HostAlreadyClaimed'

Version-Release number of selected component (if applicable):
# openshift version
openshift v3.4.0.21+ca4702d
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0


How reproducible:
always

Steps to Reproduce:
1. make sure the router is running
2. enable wildcard route for router
   #oc env dc router ROUTER_ALLOW_WILDCARD_ROUTES=true
3. Create app/service/edge route
 $ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/caddy-docker.json -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/edge/service_unsecure.json -f https://raw.githubusercontent.com/zhaozhanqi/subdomain/master/route_edge.json

4. Create another service/route
  oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/reencrypt/service_secure.json -f https://raw.githubusercontent.com/zhaozhanqi/subdomain/master/route_reen.json

5. # oc get route
NAME                 HOST/PORT               PATH      SERVICES           PORT      TERMINATION
aecured-edge-route   test-edge.example.com             service-unsecure   <all>     edge
route-reencrypt      test-reen.example.com             service-secure     <all>     reencrypt

6. access the edge route 

Actual results:
step 6: 
 curl --resolve test-edge.example.com:443:$router_ip https://test-edge.example.com -k
Hello-OpenShift-1 https-8443

Expected results:
1. step 6. should return 'Hello-OpenShift-1 http-8080'
2. step 4 route should mark as 'HostAlreadyClaimed'

Additional info:

Comment 1 Ram Ranganathan 2016-11-08 04:17:41 UTC
We don't displace hosts within the same owner namespace - so this is working as designed. Am still on the fence/mulling making this fix as it does introduce other issues we would need to fix (older->newer->older and newer->older->newer transitionary routes would give different statuses). 
If we do fix this, then bugz https://bugzilla.redhat.com/show_bug.cgi?id=1391338 would be related.

Comment 2 Ram Ranganathan 2016-11-08 22:33:31 UTC
Fixes in PR: https://github.com/openshift/origin/pull/11849

Comment 3 Troy Dawson 2016-11-11 19:33:18 UTC
This has been merged into ose and is in OSE v3.4.0.25 or newer.

Comment 5 zhaozhanqi 2016-11-14 02:18:31 UTC
Verified this issue on OSE v3.4.0.25

The later route will be as 'HostAlreadyClaimed'

Comment 7 errata-xmlrpc 2017-01-18 12:49:47 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/RHBA-2017:0066