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

[Suggestion] Use separate commands for each provider #29

Open
burtonr opened this issue Jan 20, 2020 · 1 comment
Open

[Suggestion] Use separate commands for each provider #29

burtonr opened this issue Jan 20, 2020 · 1 comment

Comments

@burtonr
Copy link

burtonr commented Jan 20, 2020

Rather than using an ambiguous string to define a provider, rather have each provider as a sub-command to the create command

Expected Behaviour

Have better type safety, better discovery, and easier usage for users

Current Behaviour

Run the create command and add flags as they are needed. Different per provider

Possible Solution

Create separate commands for each provider. The files are already separated, this would just be to add the &cobra.Command{} to the top of each file, and adding the commands to the create command.

The added bonus here is that there can be provider specific help information displayed in the terminal. An excellent use of the help text would be to display what is being created... (this is only known by reading the code, or inlets-operator readme)

$ inletsctl create gcp --help
Create an exit node on Google Cloud Platform.

Note: The account associated with the access token 
    will need compute.firewalls.create and serviceaccount user permissions

Usage: 
    inletsctl create gcp \
        --access-token-file $HOME/gcp-token.json \
        --zone "us-central1-a" \
        --project-id "awesomness"

Flags:
  ...

This would also allow the flags available to be specific to the provider being used rather than having to negotiate a long list where some are relevant, and others are not.

It also provides an outlet for provider specific information. In the above example, this includes access permissions needed for inletsctl needs to be successful

It would also remove 19 if checks each with a string value defined each time (maintenance overhead).

Steps to Reproduce (for bugs)

N/A

Context

I read through the code to know what each flag was being used for in the specific provider I was planning on using. Some of the flags are called out in the help, but not all.
"Do the commands with no provider called out mean it's required for all or none?"

eg: --region

"What happens if I leave one of the flags empty?"

eg: --remote-tcp

Also, there is no specific documentation for any one provider. In the demo gif, it's DigitalOcean, in the readme, there is an example for Scaleway, but again nothing inclusive

Your Environment

  • inlets version inlets --version
    Version: 0.3.9
  • Docker/Kubernetes version docker version / kubectl version:
    N/A
  • Operating System and version (e.g. Linux, Windows, MacOS):
    Ubuntu Linux
  • Link to your project or a code example to reproduce issue:
    N/A
@burtonr
Copy link
Author

burtonr commented Jan 22, 2020

I've updated the issue with more detail in the "Possible Solution" to show how there could be provider specific help information displayed in the output.

Currently, the experience with anything other than DigitalOcean, is run it, see why it failed, fix it, run it again, repeat. This is a poor user experience.

It may also be worth noting that the k3sup project is already organized like this with the apps command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant