You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
oc expose - unclear whether I can specify the target port when exposing a service with a new route #6094
I should be able to specify the target port when exposing a service, new app and the console are being changed to always specify a target port on a route because we want to promote that behavior
The help text leads me to believe that --target-port is only for when i'm exposing something like a dc by creating a service, and NOT when i am creating a route to expose a service
At a quick glance by @deads2k earlier it seems like (1) is not allowed and (2) is currently accurate.
I'm more concerned about having many mutually exclusive flags with generic help.
To be a little more crisp. We have lots of flags that may be used in some contexts and not others. Given that we end up having to have separate paths to handle flag validation in these cases and then we're stuck dealing with conflicting flags or different meanings, I'm hard pressed to say that this makes it easier to users to do what they want.
Given that it makes it harder for users to predict what's going to happen, harder to write code that works, and harder to review/maintain that code, I don't see a lot to recommend the approach over tailored subcommands.
oc expose --help
--target-port: Passes the "target port" option to the generator. Optional or required.
--port: Passes the "port" option to the generator. Optional or required.
Once expose supports pods, rcs, dcs, deployments, ingress, services, endpoints, and routes, we will have so many conflicting mutually exclusive or ignored or differently-interpeted flags that the only sane flag help will be "See extended documentation for usage". That's a sad state of affairs.
At that point, we essentially have subcommands, but without useful flag help, or command-parsing/validation assistance
Well, not really. We could document mutually exclusive flags if it's a real pain point. Or validation can teach a user.
"uh uh uh, you didn't say the magic word. uh uh uh, ..."
Printing the help for this command is really difficult. "This flag means X sometimes and Y other times". "If you say 'foo' here, then you use 'bar' there". "Oh, you can't specify that flag when you're running this time"
Clear examples, it's two groups of resources in play: routes, ingress and all the rest. We already default generators based on the input resource and once upstream supports ingress it will be official. If I want to expose a {route,ingress} there are these flags I may need to use.
Documentation for generators. We should already have some on them. For more advanced users that feel adventurous.
Activity
jwforres commentedon Nov 25, 2015
cc @liggitt @derekwaynecarr @Kargakis
deads2k commentedon Nov 25, 2015
You can see the result of how we're trying to share the same command to build different things here: https://github.com/openshift/origin/blob/master/pkg/cmd/cli/cmd/expose.go#L156. I don't think this easier than subcommand approach.
0xmichalis commentedon Nov 25, 2015
#5578 fixes this. I opted in using --port instead of --target-port but I don't feel strong on it. Any preferences?
deads2k commentedon Nov 25, 2015
--target-portseems more natural to meI'm more concerned about having many mutually exclusive flags with generic help.
deads2k commentedon Nov 25, 2015
To be a little more crisp. We have lots of flags that may be used in some contexts and not others. Given that we end up having to have separate paths to handle flag validation in these cases and then we're stuck dealing with conflicting flags or different meanings, I'm hard pressed to say that this makes it easier to users to do what they want.
Given that it makes it harder for users to predict what's going to happen, harder to write code that works, and harder to review/maintain that code, I don't see a lot to recommend the approach over tailored subcommands.
liggitt commentedon Nov 25, 2015
</sarcasm>0xmichalis commentedon Nov 25, 2015
@liggitt nah, then the user has to know what each generator does with these options.
liggitt commentedon Nov 25, 2015
which is exactly what we have now
0xmichalis commentedon Nov 25, 2015
Well, not really. We could document mutually exclusive flags if it's a real pain point. Or validation can teach a user.
liggitt commentedon Nov 25, 2015
Once
exposesupports pods, rcs, dcs, deployments, ingress, services, endpoints, and routes, we will have so many conflicting mutually exclusive or ignored or differently-interpeted flags that the only sane flag help will be "See extended documentation for usage". That's a sad state of affairs.At that point, we essentially have subcommands, but without useful flag help, or command-parsing/validation assistance
deads2k commentedon Nov 25, 2015
"uh uh uh, you didn't say the magic word. uh uh uh, ..."
Printing the help for this command is really difficult. "This flag means X sometimes and Y other times". "If you say 'foo' here, then you use 'bar' there". "Oh, you can't specify that flag when you're running this time"
0xmichalis commentedon Nov 25, 2015
I see a couple of steps here:
Clear examples, it's two groups of resources in play: routes, ingress and all the rest. We already default generators based on the input resource and once upstream supports ingress it will be official. If I want to expose a {route,ingress} there are these flags I may need to use.
Documentation for generators. We should already have some on them. For more advanced users that feel adventurous.
liggitt commentedon Nov 25, 2015
route and ingress already behave differently re: targetport (I think)