uaa-cli icon indicating copy to clipboard operation
uaa-cli copied to clipboard

Allow overriding the uaa-cli config directory with an environment variable

Open AP-Hunt opened this issue 5 years ago • 6 comments

By default, uaa-cli config file will be stored in $HOME/.uaa/config.json, but if the environment variable UAA_HOME is set, then the config file will be stored there instead.

This allows for some flexibility in how users of the tool use it, in the same ways that cf-cli does. For example, scoping the config of uaa-cli to the lifetime of a subshell. The linked example is using cf-cli, but I think it demonstrates the idea.

AP-Hunt avatar Aug 30 '19 19:08 AP-Hunt

:white_check_mark: Hey AP-Hunt! The commit authors and yourself have already signed the CLA.

cfdreddbot avatar Aug 30 '19 19:08 cfdreddbot

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/168227802

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar Aug 30 '19 19:08 cf-gitbot

Hi there. Thanks for the PR & sorry for the slow response.

I'm unsure if this is a feature we'd want to incorporate in the CLI. I get the need, but we generally think of this cli more as a debugging tool rather than an administration tool.

I'll bring this up with the team. Could you tell me more about how you're using the CLI?

shamus avatar May 21 '20 22:05 shamus

I'll bring this up with the team. Could you tell me more about how you're using the CLI?

Sure! I work with multiple CloudFoundry distributions and have occasions to use the UAA CLI for debugging as you describe. On those occasions, I might need to contact multiple UAA deployments within the lifetime of a single token.

When doing this with the CF CLI, I scope my CloudFoundry session to the lifetime of a subshell. This allows me to be confident in which foundry I'm talking to, and to know that once I exit the subshell I'll be unable to accidentally talk to that foundry (I can talk more about how if you'd like). It also has the added benefit of removing any highly privileged access tokens from my machine as soon as I'm finished with them.

My proposed change enables the same behavior with the UAA CLI, while maintaining the existing behavior.

AP-Hunt avatar Jun 06 '20 11:06 AP-Hunt

Our team at VMware is also using this CLI and we're facing an issue where 2 scripts are clobbering the same home directory. It would be great to have the ability to set different config directories.

ssapra avatar Nov 12 '20 18:11 ssapra

Hi folks,

Platform operators like me typically need to “debug” many UAAs for each CF foundation they operate: one for BOSH, one for Ops Manager, one for Cloud Foundry, one for Concourse, etc… And we usually operate many foundations for (P)CF customers!

In the typical pattern, we would create one folder per UAA, and we would set the UAA_HOME to $PWD in some .envrc Direnv config in each one of those. So we would end up with specific uaa CLI configs, one per UAA, and and when we would enter one of those folers we would automatically target the correct UAA.

I already have similar setup for the cf CLI with the CF_HOME being locally customized by Direnv.

So VMware fellows, please consider this pull request, as it would positively impacts the productivity of real-life platform operators!

Best, Benjamin

bgandon avatar Dec 15 '20 21:12 bgandon