Skip to content

oc expose - unclear whether I can specify the target port when exposing a service with a new route #6094

Closed

Description

@jwforres
  1. 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
  2. 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.

Activity

  1. jwforres commented on Nov 25, 2015

    @jwforres
    MemberAuthor
  2. deads2k commented on Nov 25, 2015

    @deads2k
    Contributor

    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.

  3. 0xmichalis commented on Nov 25, 2015

    @0xmichalis
    Contributor

    #5578 fixes this. I opted in using --port instead of --target-port but I don't feel strong on it. Any preferences?

  4. deads2k commented on Nov 25, 2015

    @deads2k
    Contributor

    --target-port seems more natural to me

    I'm more concerned about having many mutually exclusive flags with generic help.

  5. deads2k commented on Nov 25, 2015

    @deads2k
    Contributor

    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.

  6. liggitt commented on Nov 25, 2015

    @liggitt
    Contributor
    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.
    

    </sarcasm>

  7. 0xmichalis commented on Nov 25, 2015

    @0xmichalis
    Contributor

    @liggitt nah, then the user has to know what each generator does with these options.

  8. liggitt commented on Nov 25, 2015

    @liggitt
    Contributor

    @liggitt nah, then the user has to know what each generator does with these options.

    which is exactly what we have now

  9. 0xmichalis commented on Nov 25, 2015

    @0xmichalis
    Contributor

    which is exactly what we have now

    Well, not really. We could document mutually exclusive flags if it's a real pain point. Or validation can teach a user.

  10. liggitt commented on Nov 25, 2015

    @liggitt
    Contributor

    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

  11. deads2k commented on Nov 25, 2015

    @deads2k
    Contributor

    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"

  12. 0xmichalis commented on Nov 25, 2015

    @0xmichalis
    Contributor

    I see a couple of steps here:

    1. 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.

    2. Documentation for generators. We should already have some on them. For more advanced users that feel adventurous.

  13. liggitt commented on Nov 25, 2015

    @liggitt
    Contributor

    route and ingress already behave differently re: targetport (I think)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions