Hide Forgot
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:
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.
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.
*** This bug has been marked as a duplicate of bug 1314619 ***