doctl icon indicating copy to clipboard operation
doctl copied to clipboard

Allow configuring defaults per context

Open rsaffi opened this issue 5 years ago • 2 comments

Right now we can use the context parameter to create different auth-contexts on the config.yaml, which already helps a lot, but I have a few suggestions on top of that:

  1. Although stateless has it's advantages, it'd be nice to have an option to modify default behaviour to stateful.
  2. It would be nice to have other settings be context aware, like compute.ssh.ssh-key-path, compute.ssh.ssh-user, compute-ssh.ssh-port and many other things.

The ability to have the option of setting context in a stateful way makes suggestion (2) above make even more sense. You switch the context once and all those settings are already adjusted for you, so no need to be passing them as arguments on the command-line.

rsaffi avatar Sep 14 '18 08:09 rsaffi

Thanks for the suggestions @rsaffi! Re: 1, you can change the default context using the doctl auth switch --context new-default-context command. Does that help?

kamaln7 avatar Sep 14 '18 15:09 kamaln7

Hello @kamaln7!

Thanks for the prompt reply! Actually I stand corrected on that. Yes, there's already the possibility of doing a stateful change of context like that; so no need to keep passing --context=something on every command.

But I still stand to the fact that it'd be nice to be able to also define some different defaults on the config file per context, like the aforementioned settings, beside others.

I myself use a default ssh user/port/key for my private account but a different one for my company's account and I believe the same probably happens to others.

SSH is just a simple/silly example of what we could benefit with having different defaults for different contexts. But thinking of other defaults (droplet/volumes/dns creation, for instance), there could be great benefits on having this option separate per context.

rsaffi avatar Sep 15 '18 15:09 rsaffi