Bug 1371851 - "oc new-app" failed resolve template when the template name defined using template parameter
Summary: "oc new-app" failed resolve template when the template name defined using tem...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Cesar Wong
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-31 09:25 UTC by Dongbo Yan
Modified: 2016-09-08 18:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-08 18:13:17 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Dongbo Yan 2016-08-31 09:25:09 UTC
Description of problem:
"oc new-app" failed resolve template when the template name defined using template parameter.

Version-Release number of selected component (if applicable):
openshift v3.3.0.27
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git

How reproducible:
Always

Steps to Reproduce:
1.Create a project, create an application
 $ oc new-app https://raw.githubusercontent.com/openshift-qe/v3-testfiles/4049744e9f2d37229a1aeaade3fc7f1dfc5c66ef/templates/tc479059/application-template-parameters.json
2.
3.

Actual results:
--> Deploying template ${TEMPLATE_NAME} for "https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/templates/tc479059/application-template-parameters.json"

${TEMPLATE_NAME}
---------
This example shows how to create a simple ruby application in openshift origin v3

* With parameters:
* ADMIN_USERNAME=adminKN8 # generated
* ADMIN_PASSWORD=IToCjjlR # generated
* MYSQL_USER=userO7L # generated
* MYSQL_PASSWORD=bG6vybvq # generated
* MYSQL_DATABASE=root
* GIT_URI=git://github.com/openshift/ruby-hello-world.git
* KIND_BC=BuildConfig
* IMAGESTREAM_SPEC_REPO=openshift/ruby-20-centos7
* TEMPLATE_NAME=ruby-helloworld-sample

--> Creating resources with label ...
error: ImageStream "origin-ruby-sample" is invalid: metadata.labels: Invalid value: "${TEMPLATE_NAME}": must match the regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])? (e.g. 'MyValue' or 'my_value' or '12345')
error: ImageStream "ruby-22-centos7" is invalid: metadata.labels: Invalid value: "${TEMPLATE_NAME}": must match the regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])? (e.g. 'MyValue' or 'my_value' or '12345')
error: BuildConfig "ruby-sample-build" is invalid: metadata.labels: Invalid value: "${TEMPLATE_NAME}": must match the regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])? (e.g. 'MyValue' or 'my_value' or '12345')
error: DeploymentConfig "frontend" is invalid: [metadata.labels: Invalid value: "${TEMPLATE_NAME}": must match the regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])? (e.g. 'MyValue' or 'my_value' or '12345'), spec.template.labels: Invalid value: "${TEMPLATE_NAME}": must match the regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])? (e.g. 'MyValue' or 'my_value' or '12345')]
--> Failed 

Expected results:
Create application successfully

Additional info:
If use $ oc process -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/4049744e9f2d37229a1aeaade3fc7f1dfc5c66ef/templates/tc479059/application-template-parameters.json | oc create -f -
will create application successfully

Comment 1 Ben Parees 2016-09-08 18:13:17 UTC
template name isn't a substitutable field and i can't think of a good use case for making it one.  the template message is substitutable and should be able to fill any need.

furthermore it's confusing to have a template registered with one name, but then pick up a different name on substitution.


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