Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1362047 - [userinterface_public_689]If Label name is "template", then this pair of label in label-editor will be regarded as readonly on web console, user could not change its value
Summary: [userinterface_public_689]If Label name is "template", then this pair of labe...
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Jessica Forrester
QA Contact: Yadan Pei
Depends On:
TreeView+ depends on / blocked
Reported: 2016-08-01 09:05 UTC by Yadan Pei
Modified: 2016-09-19 13:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-09-19 13:56:20 UTC
Target Upstream Version:

Attachments (Terms of Use)
ReadonlyLabel (deleted)
2016-08-01 09:05 UTC, Yadan Pei
no flags Details

Description Yadan Pei 2016-08-01 09:05:12 UTC
Description of problem:
On pages like create-fromiamge, create-fromtemplate and edit-autoscaler where user could manage labels, if label name is defined as "template", then this pair of label will be regarded as readonly, user could not update its value on web console. However oc edit could change value successfully for labels whose name is "template"

Version-Release number of selected component (if applicable):
openshift v1.3.0-alpha.2+f6f7de3-dirty(latest origin-web-console)
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

How reproducible:

Steps to Reproduce:
1. Download test template file
# wget
2. Add one pair of labels "test": "testtemplate" to application-template-stibuild.json
  "labels": {
    "template": "application-template-stibuild",
    "test": "testtemplate"
3. Create a project and add template to project
# oc new-project test
# oc create -f application-template-stibuild.json
4. Login to web console
5. Click Add to project, select tempalte "ruby-helloworld-sample" in Browse Catalog tab
6. Check Labels on create/fromtemplate page
7. Edit label value using oc, change value to application-template-stibuild-update
# oc edit template ruby-helloworld-sample
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be 
# reopened with the relevant failures.
apiVersion: v1
kind: Template
  template: application-template-stibuild-update
  test: testtemplate
template "ruby-helloworld-sample" edited

Actual results:
6. "template": "application-template-stibuild" is readonly, use could not update on this pair of Label, refer to attachment

Expected results:
6. User could update Labels at all levels on web console just like CLI does

Additional info:

Comment 1 Yadan Pei 2016-08-01 09:05:42 UTC
Created attachment 1186304 [details]

Comment 2 bpeterse 2016-08-01 14:16:56 UTC
This was true in the previous osc-key-values directive, for the label editor both "template" and "app" were set to readonly.  

We can easily change this if it is not desirable.

Comment 3 bpeterse 2016-08-01 15:42:01 UTC
Ok, fix for this will be to:
1. no longer make 'template' and 'app' readonly in the label-editor directive
2. in the create flow, we will do a readonly copy of existing labels under a show/hide link like we do for env vars, with an additional editor below it to allow the user to override.  
3. on submit, save only the ones the user chooses to override. should not need to merge.

Comment 4 bpeterse 2016-08-01 15:43:25 UTC
actually will do a merge of the "existing" with the "user defined". we will save it all.

Comment 5 Yadan Pei 2016-08-17 06:33:28 UTC
Hi jessica,

Any PR including this fix? I'm not sure about the changed/updated behavior

Comment 6 Jessica Forrester 2016-08-17 11:16:48 UTC
Sorry forgot to include what origin PR it was merging in with.  This merged into origin-web-console in and should definitely be merged into origin now.  For Add to Project where you pick a builder image like PHP, you will see a read only Label table that has the app label set to whatever you put into the Name field at the top of the form, as you update that field it updates that label.  You can override the app label in the editable fields below it.  For templates, any labels that were on the template, like template=application-template-stibuild on the sample app example, will show up in the readonly part of the label form, in addition the app label will be set to the name of the template.  Any of these can be overriden in the editable form below it.

Comment 7 Yadan Pei 2016-08-18 05:31:39 UTC
Thanks jessica.

Tried today against openshift v1.3.0-alpha.3+a6993d3
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git

Check label-editor on create/fromimage and create/fromtemplate, now 'template' and 'app' are set as readonly Label and user could overwrite them by edit them to other value in editable fields below.

This works well I think, move to VERIFIED

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