Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace <pod> <service> with shorter naming conventions & rationalize #8

Closed
emk opened this issue Oct 5, 2016 · 2 comments
Closed
Assignees
Labels

Comments

@emk
Copy link
Contributor

emk commented Oct 5, 2016

Our current argument convention looks like this:

cage [options] run [exec options] <pod> [<command> [--] [<args>...]]
cage [options] exec [exec options] <pod> <service> <command> [--] [<args>..]
cage [options] shell [exec options] <pod> <service>
cage [options] test <pod> <service>

Nobody likes typing <pod> <service>, especially when service names are often globally unique. Additionally, the run command needs some way to specify a pod normally, but to also allow the specification of a service. And logs (#7) raises some design issues of its own.

After some discussion with @dkastner, we'd like to propose three argument types:

  • <pod>, for commands which can only accept a pod.
  • <service>, for commands which can accept a service. This can be specified as either $POD/$SERVICE, or if the service name is unique, just $SERVICE.
  • <pod_or_service> looks for $POD, $POD/$SERVICE and a unique $SERVICE, in that order.

With this design, our subcommands would look like:

cage [options] logs [log options] [<pods_or_services>..]
cage [options] run [exec options] <pod_or_service> [<command> [--] [<args>...]]
cage [options] exec [exec options] <service> <command> [--] [<args>..]
cage [options] shell [exec options] <service>
cage [options] test <service>

Comments and feedback are welcome!

@emk emk added the RFC label Oct 5, 2016
@emk emk self-assigned this Oct 6, 2016
@emk emk mentioned this issue Oct 7, 2016
@erithmetic
Copy link
Contributor

erithmetic commented Oct 7, 2016

I like the third option the best. I think it covers the 80% usage case.

@emk
Copy link
Contributor Author

emk commented Oct 8, 2016 via email

emk added a commit that referenced this issue Oct 11, 2016
I'm laying the groundwork for the new "target" argument types with a
little refactoring first.
emk added a commit that referenced this issue Oct 11, 2016
@emk emk closed this as completed in b6b759e Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants