Bug 1247676
Summary: | When a required parameter from an application template is missing, we need to tell the user. | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Grant Shipley <gshipley> |
Component: | Build | Assignee: | Ben Parees <bparees> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Wenjing Zheng <wzheng> |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0.0 | CC: | aos-bugs, bparees, dmcphers, jliggitt, jokerman, libra-bugs, libra-onpremise-devel, mmccomas, rcarvalh, xtian |
Target Milestone: | --- | Keywords: | UpcomingRelease |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-23 14:27: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: | |
Embargoed: |
Description
Grant Shipley
2015-07-28 15:17:59 UTC
Template parameters now support an optional "required" attribute. Templates should be updated to set that The CLI should be updated to process errors from a "process template" step to tell the user which parameter had errors (the errors come back with "parameters[0]" which need to be correlated to the actual parameter name) the error is a little better, it shows you the name of the parameter: error: error processing template test/ruby-helloworld-sample: template "ruby-helloworld-sample" is invalid: parameters: invalid value '<*>(0xc20cd4dd80)parameters[4].value: required value, Details: parameter MYSQL_DATABASE is required and must be specified', Details: failure to generate parameter value we might be able to clean that message up a little more. we're never going to do the abort/rollback proposal, you can just run the template again and it will create the things that are missing. we do not operate on a transactional model in v3. better fix for the error message here: https://github.com/openshift/origin/pull/4641 If the template contains black value for required parameter, below error will appear when create with it with devenv-fedora-2340. [wzheng@openshiftqe test]$ oc new-app sti2.json error: error processing template bug3/ruby-helloworld-sample: template "ruby-helloworld-sample" is invalid: parameters: invalid value '{Name:MYSQL_DATABASE DisplayName: Description:database name Value: Generate: From: Required:true}', Details: template.parameters[4]: parameter MYSQL_DATABASE is required and must be specified But the original bug is about creating with invalid values which is not required parameter, like sourceURi, for if creating with blank sourceURi, the error still is not that clear like: Error: BuildConfig "jws-app" is invalid: parameters.source.git.uri: required value; can this be changed to more readable? Ben, Wenjing so this is really about improving the error reporting from create operation where when it fails, we should give users more clean message about why it failed? The 'parameters.source.git.uri' is not a template parameter, it is BuildConfig field. So the error you seen is a validation error coming from the REST call. michal: yes that's correct. i cleaned up the template part, but the create side logic will be harder to change. I'm trying to find out if there's anything left to be fixed here. The introduction of the "required" flag in template parameters solved the original issue: $ oc new-app --file=https://raw.githubusercontent.com/jboss-openshift/application-templates/master/webserver/jws-tomcat8-basic-s2i.json --param SOURCE_REPOSITORY_URL="" error: error processing template demo/jws-tomcat8-basic-s2i: template "jws-tomcat8-basic-s2i" is invalid: parameters: invalid value '{Name:SOURCE_REPOSITORY_URL DisplayName: Description:Git source URI for applic ation Value: Generate: From: Required:true}', Details: template.parameters[2]: parameter SOURCE_REPOSITORY_URL is required and must be specified Now, if a template is not using a required template parameter to fill in the value of sourceURI, the current error message reads: $ oc new-app --file=t.json services/jws-app routes/jws-app imagestreams/jws-app Error: BuildConfig "jws-app" is invalid: spec.source.git.uri: required value deploymentconfigs/jws-app That's the standard validation error message returned from the REST API. Do we want to change that or anything else in the scope of this BZ? Sounds like no, QE are you happy with the new message: Error: BuildConfig "jws-app" is invalid: spec.source.git.uri: required value deploymentconfigs/jws-app ? OK then, I will verify this bug now. This fix is available in OpenShift Enterprise 3.1. |