Bug 1374154 - It's better to disable the create button on create app from image page when env or label name is empty
Summary: It's better to disable the create button on create app from image page when e...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: bpeterse
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-08 06:23 UTC by Yadan Pei
Modified: 2016-12-09 21:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-09 21:50:35 UTC
Target Upstream Version:


Attachments (Terms of Use)
errorinfo.png (121.79 KB, image/png)
2016-09-26 08:10 UTC, Yanping Zhang
no flags Details

Description Yadan Pei 2016-09-08 06:23:57 UTC
Description of problem:
On create app from image page, when env or label name is empty, user still could perform create action, but fianlly it will fail. It's better to disable the creation when env or label name is empty

Version-Release number of selected component (if applicable):
openshift v1.3.0-alpha.3+7f59726
kubernetes v1.3.0+52492b4
etcd 2.3.0+git


How reproducible:
Always

Steps to Reproduce:
1.Login to openshift web console and create a new project
2.Add to project -> select one image
3.Fill Name and Git Repository URL
4.In Build Configuration part, only set env value to "bc-env-value-1"
In Deployment Configuration part, only set env value to "dc-env-value-1"
In Labels part, only set Labels value to "label-value-1"
5.Click "Create"

Actual results:
5. Could create but fianlly failed, errors indicating cannot create <resource> is shown on next step page
Cannot create route "php". Route  "php" is invalid: [metadata.labels: Invalid value: "": name part must  be non-empty, metadata.labels: Invalid value: "": name part must match  the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or  'my.name' or '123-abc')].

Cannot create build config "php". BuildConfig  "php" is invalid: [metadata.labels: Invalid value: "": name part must  be non-empty, metadata.labels: Invalid value: "": name part must match  the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or  'my.name' or '123-abc'), spec.strategy.sourceStrategy.env[0].name:  Required value].

Cannot create deployment config "php". DeploymentConfig  "php" is invalid: [metadata.labels: Invalid value: "": name part must  be non-empty, metadata.labels: Invalid value: "": name part must match  the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or  'my.name' or '123-abc'), 
spec.template.labels: Invalid value: "": name  part must be non-empty, spec.template.labels: Invalid value: "": name  part must match the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g.  'MyName' or 'my.name' or '123-abc'),  spec.template.spec.containers[0].env[0].name: Required value].

Cannot create image stream "php". ImageStream  "php" is invalid: [metadata.labels: Invalid value: "": name part must  be non-empty, metadata.labels: Invalid value: "": name part must match  the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or  'my.name' or '123-abc')].

Cannot create service "php". Service  "php" is invalid: [metadata.labels: Invalid value: "": name part must  be non-empty, metadata.labels: Invalid value: "": name part must match  the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or  'my.name' or '123-abc')].

Expected results:
5. When env or label name is empty, should prevent user from creating 

Additional info:

Comment 1 bpeterse 2016-09-23 15:53:23 UTC
PR open to address this issue: https://github.com/openshift/origin-web-console/pull/584

Comment 2 bpeterse 2016-09-23 18:34:17 UTC
PR merged into origin-web-console, not yet vendored back to origin.

Comment 3 Yanping Zhang 2016-09-26 08:09:39 UTC
After tested against the pr, found that there will be error showing "Key is required" if set env/label's value but key is empty, and the "Create" button is disabled.
Then remove the env/label's value, the error is still there with "Create" button disabled. Pls refer to the attachment. This should be fixed.

Comment 4 Yanping Zhang 2016-09-26 08:10:33 UTC
Created attachment 1204708 [details]
errorinfo.png

Comment 5 bpeterse 2016-09-26 13:50:47 UTC
Looking into this

Comment 6 bpeterse 2016-09-26 15:07:25 UTC
At present, here is the behavior:
- pressing the "x" control to trigger the clear row fn will eliminate the warning
- pressing the "delete" key to delete the values will eliminate the warning
- using ctrl + x to "cut" the value will not eliminate the warning.  This does not trigger the keyup event (oddly)

Comment 7 bpeterse 2016-09-26 15:57:52 UTC
PR to the underlying editor: https://github.com/openshift/angular-key-value-editor/pull/117

will PR the web console once that merges.

Comment 8 Yadan Pei 2016-11-02 08:16:29 UTC
Checked against v3.4.0.18+ada983f

1. Type only env/label value, error info will prompt "Key is required" and Create button is disabled

2. Using ctrl + x to cut the env/label value, the error will not be eliminated, and Create button still disabled

3. Clear value using backspace, the error will not be eliminated, and Create button still disabled

4. Clicking "x" control will eliminate the warning and Create button got enabled

Move to VERIFIED


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