Bug 1375146 - Pods don't have labels added from 'create from template' page
Summary: Pods don't have labels added from 'create from template' page
Keywords:
Status: CLOSED DUPLICATE of bug 1314619
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jessica Forrester
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-12 09:47 UTC by Xingxing Xia
Modified: 2016-09-22 15:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-22 15:39:45 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Xingxing Xia 2016-09-12 09:47:34 UTC
Description of problem:
Pods don't have labels added from 'create from template' page. Other resources such as dc/rc/bc/is etc have, though.
But CLI `oc new-app <template_name> -l <Label_key_val_pairs>` can let pods have the labels.

Version-Release number of selected component (if applicable):
v3.3.0.30

How reproducible:
Always

Steps to Reproduce:
1. Login to openshift, create project
2. Prepare template:
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json
3. On web console, click "Add to project" --> select "ruby-helloworld-sample". In "Labels" section, click "Add label" to add labels, such as pairs: test=1234, test1=abcd
4. Check labels of database/frontend pods

Actual results:
4. database/frontend pods don't have the labels added from web console.

Expected results:
4. database/frontend pods should have the labels added from web console, as `oc new-app <template_name> -l <Label_key_val_pairs>` does.

Additional info:

Comment 1 Jessica Forrester 2016-09-12 13:24:09 UTC
The console has always behaved this way, the CLI behavior has been changing and there is still some debate over the current state. See a related CLI issue https://github.com/openshift/origin/issues/9314

and issues around the app label specifically:
https://github.com/openshift/origin/pull/10789
https://github.com/openshift/origin/issues/10782

Should wait for the CLI discussions to be settled on what the right solution is and then we will fix the console to match.

Comment 2 Ben Parees 2016-09-22 14:22:22 UTC
new-app behaves differently because that label logic is not part of template processing, it is part of the new-app behavior which says "add the labels provided by the user, to all the objects produced by whatever new-app is doing."  In this case, new-app processed the template, got back a list of objects, and then added the requested labels.

When adding labels to objects, new-app uses a helper method which drills down into deploymentconfigs and also adds the label to the pod template defined within the DC.

That is separate logic from the template processing logic which says "take the labels defined on the template and apply them to all top level Objects defined in the template", which is what the web console and oc process use when adding user provided labels during template instantiation.

Comment 3 Ben Parees 2016-09-22 15:39:45 UTC

*** This bug has been marked as a duplicate of bug 1314619 ***


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