Bug 1377939

Summary: [platformmanagement_public_624]Should have '--selector' option for 'oc create service' command
Product: OKD Reporter: zhou ying <yinzhou>
Component: ocAssignee: Michail Kargakis <mkargaki>
Status: CLOSED NOTABUG QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: akostadi, aos-bugs, jvallejo, mfojtik, mmccomas, yinzhou
Target Milestone: ---Keywords: Reopened, UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-22 15:57:18 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:

Description zhou ying 2016-09-21 06:03:37 UTC
Description of problem:
Didn't have '--selector' option for create service , couldn't specify the labels for service.

Version-Release number of selected component (if applicable):
openshift version
openshift v1.4.0-alpha.0+16f2d39
kubernetes v1.4.0-beta.3+d19513f
etcd 3.0.9

How reproducible:
Always

Steps to Reproduce:
1. Login OpenShift and create project;
2. Check help info for create service command;
3. Try to use '--selector' option with create service command;


Actual results:
2. There was no '--selector' option for create service command
3. Prompt error:  unknown flag: --selector


Expected results:
2. Should have selector option for create service.

Additional info:

Comment 1 Michal Fojtik 2016-10-25 14:27:27 UTC
In the kubernetes issue (https://github.com/kubernetes/kubernetes/issues/33253#issuecomment-249596119) we mention that the right approach to this would be to use `oc set selector` (once it will be available.

Do you agree that we can close this bug and wait for that feature to be backported into OpenShift?

Comment 2 zhou ying 2016-10-26 06:51:00 UTC
It's ok for me .

Comment 3 Michail Kargakis 2016-12-06 15:14:19 UTC
oc set selector should be the way to go, closing this bug

Comment 4 Aleksandar Kostadinov 2018-11-22 15:43:24 UTC
And almost 2 years later I still don't see `oc set selector` command in 3.11

While on it there are not many parameters to set when creating a service. It is only needed to set selector. Adding one parameter to the `create service` command is IMO well worth in comparison to ask user to run a separate command.

In any case, I think this issue has to be closed only after `--selector` parameter is implemented or at least the `oc set selector` command is present. At the moment I don't see any way to create a service on the command line without JSON/YAML.

Comment 5 Aleksandar Kostadinov 2018-11-22 15:57:18 UTC
we can use "oc expose dc somedc", this should be enough for the common user