Bug 1241392

Summary: Failed to create app using source code since failed to create deploymentconfig
Product: OKD Reporter: Wei Sun <wsun>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Wei Sun <wsun>
Severity: high Docs Contact:
Priority: high    
Version: 3.xCC: libra-bugs, mmccomas, wjiang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1245032 (view as bug list) Environment:
Last Closed: 2015-09-08 20:13:24 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:
Bug Depends On:    
Bug Blocks: 1245032    

Description Wei Sun 2015-07-09 07:15:31 UTC
Description of problem:
On web console,try to create the application using source code,but it failed.
The error is: 
Cannot create DeploymentConfig ruby-hello-world. DeploymentConfig "ruby-hello-world" is invalid: template.controllerTemplate.template.spec.containers[0].ports[0].name: invalid value 'ruby-hello-world-tcp-8080': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hypens cannot be adjacent to other hyphens): e.g. "http"

Version-Release number of selected component (if applicable):
devenv-fedora_1961

How reproducible:
Always

Steps to Reproduce:
1.Create application using source code on web console
2.
3.

Actual results:
Failed to create ruby-hello-world in project wsuntest

Cannot create DeploymentConfig ruby-hello-world. DeploymentConfig "ruby-hello-world" is invalid: template.controllerTemplate.template.spec.containers[0].ports[0].name: invalid value 'ruby-hello-world-tcp-8080': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hypens cannot be adjacent to other hyphens): e.g. "http"

Expected results:
Could create the application successfully

Additional info:
Could create the app using source code via oc
$ oc new-app openshift/ruby-20-centos7~https://github.com/openshift/ruby-hello-world.git -n wsuntest --config=openshift.local.config/master/admin.kubeconfig 
imagestreams/ruby-20-centos7
imagestreams/ruby-hello-world
buildconfigs/ruby-hello-world
deploymentconfigs/ruby-hello-world
services/ruby-hello-world
A build was created - you can run `oc start-build ruby-hello-world` to start it.
Service "ruby-hello-world" created at 172.30.82.227 with port mappings 8080.

Comment 1 weiwei jiang 2015-07-09 07:57:27 UTC
Management console doesn't check if the port.name exceed the limitation. 
https://github.com/openshift/origin/blob/master/assets/app/scripts/services/applicationGenerator.js#L58

And `oc new-app` will guarantee the port.name is a valid IANA_SVC_NAME.
https://github.com/openshift/origin/blob/master/pkg/generate/app/app.go#L343

So should the Management console do the same things like oc to generate a valid name?

Comment 2 Samuel Padgett 2015-07-17 13:23:43 UTC
There appears to be a problem with build configs as well:

Cannot create BuildConfig nodejs-example. BuildConfig "nodejs-example" is invalid: spec.output.to.kind: required value

Comment 3 Samuel Padgett 2015-07-17 14:05:24 UTC
https://github.com/openshift/origin/pull/3752

Comment 4 Wei Sun 2015-07-20 04:57:25 UTC
Checked this bug in devenv_fedora_2024,now could create the application successfully using source code on web console.
After the bug is moved to ON_QA,we will verify it.

Comment 5 Wei Sun 2015-07-21 01:51:30 UTC
Verified this bug in devenv-fedora_2032.
Now the application could be created successfully.