Bug 1331303

Summary: [userinterface_public_646]Hostname is not set automatically for route when edit the route without specifying Hostname on web console
Product: OKD Reporter: Yanping Zhang <yanpzhan>
Component: Management ConsoleAssignee: Ben Bennett <bbennett>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas, pweil, ramr
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 13:51:03 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:
Attachments:
Description Flags
Update-route-successfully
none
Warning-info none

Description Yanping Zhang 2016-04-28 09:00:56 UTC
Created attachment 1151780 [details]
Update-route-successfully

Description of problem:
When edit an existing route on web console, there is reference info saying "Public hostname for the route. If not specified, a hostname is generated.", after click "Save" without specifying "Hostname", it prompts info that the route is updated successfully. But in fact Hostname is not set automatically. And if create a new route without specifying Hostname, there will be a Hostname automatically set for the route.

Version-Release number of selected component (if applicable):
openshift v1.3.0-alpha.0-167-g4589987
kubernetes v1.3.0-alpha.1-331-g0522e63
etcd 2.3.0


How reproducible:
Always

Steps to Reproduce:
1.Create an app, it will create a route automatically.
$oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json
2.Edit the route on web console without specifying Hostname, and click "Save".
3.

Actual results:
2.It shows info that route was successfully updated, but in fact Hostname was not set, on the route page, could see "<unknown host> rejected by router "router"". Refer to attachment.

Expected results:
2.Hostname should be set automatically.

Additional info:

Comment 1 Yanping Zhang 2016-04-28 09:02:06 UTC
Created attachment 1151781 [details]
Warning-info

Comment 2 Samuel Padgett 2016-04-28 15:30:18 UTC
Paul, what should happen when you edit a route and remove hostname?

Comment 3 Paul Weil 2016-04-28 17:00:10 UTC
Ram, going through the history of this it looks like it was always only in the REST create (and then moved to the create strategy when REST was refactored).  

That seems a little odd.  This route would be dropped by the router since it is not in a valid format unless the router was configured with the DNS pattern override in which case a blank host would be fine.

Should we allocate a host name on updates in PrepareForUpdate?  Does it make sense to have the host name be immutable?  Probably not although I do wonder how this would work in the future with sharding strategies that work based on route attributes.

Comment 4 Ram Ranganathan 2016-04-28 18:47:51 UTC
@Paul, Yeah that is a bug - we should do it for both PrepareFor{Create,Update} if  Spec.Host not set. Though that said, there's an overlap between the hostname generator and the router subdomain config parameter.

Comment 5 Paul Weil 2016-04-28 20:40:30 UTC
https://github.com/openshift/origin/pull/8677

Comment 6 Ben Bennett 2016-06-14 15:05:32 UTC
Paul, thanks!  Is there additional work beyond that PR that needs to happen for this, or can we close this bug?

Comment 7 Paul Weil 2016-06-14 15:18:55 UTC
ready for testing

Comment 8 Yanping Zhang 2016-06-15 04:54:54 UTC
Checked on devenv-rhel7_4374.
When update hostname of the route, it will prompt error info to indicate that the field is immutable.

Since the field is immutable, why not disable the input box for hostname, and remove this info:"Public hostname for the route. If not specified, a hostname is generated."? Customers may feel confused by it.
Assign it back first, if dev think this is acceptable and won't update, pls move to ON_QA, then QE will verify it.

Comment 9 Paul Weil 2016-06-15 12:36:15 UTC
Last minute update :).  This behavior was just changed yesterday to avoid stealing routes and the field is now immutable.  I think your test was valid.  https://github.com/openshift/origin/pull/9325

Comment 10 Yanping Zhang 2016-06-20 10:35:06 UTC
Checked on devenv-rhel7_4409, routes can be edited and hostname is immutable and can not be updated now. 
Move the bug to Verified.