app-registry / appr

Apache License 2.0
56 stars 18 forks source link

Expose APPR_CONF_DIR via command-line #61

Closed sbueringer closed 7 years ago

sbueringer commented 7 years ago

So I have the following use-case:

We use the Quay Enterprise Registry in combination with the App-Registry Helm plugin. We have multiple organizations with Application Repositories and each organization has it's own robot account. This requires that we can login with different robot accounts into the same registry at the same "time"(if we don't want to login before every push). In the .appr/auths.yaml the credentials are stored per URL/Registry.

It would be nice if we could set the APPR_CONF_DIR (which is already there in the source code) per command line so that we can switch "context" between helm registry calls, e.g.:

It looks like it's not possible to use the environment variables APPR_CONF_DIR when using appr as Helm plugin (it's just ignored):

export APPR_CONF_DIR=.appr2
helm registry login -k -u <user> -p <pw> <registry-url>
# credentials are still stored in ~/.appr/auths.yaml

A command line flag for the registry plugin would solve this.

ant31 commented 7 years ago

Thanks for the proposal. I have same use case, for now login is per domain, but I think I have branch somewhere that was allowing login per namespace.

appr login quay.io #default for domain appr login quay.io/foo #login for the foo namespace

What do you think of that approach?

Still we should be able to chose the appr home directory.

Le 3 août 2017 07:32, "Stefan Büringer" notifications@github.com a écrit :

So I have the following use-case:

We use the Quay Enterprise Registry in combination with the App-Registry Helm plugin. We have multiple organizations with Application Repositories and each organization has it's own robot account. This requires that we can login with different robot accounts into the same registry at the same "time"(if we don't want to login before every push). In the .appr/auths.yaml the credentials are stored per URL/Registry.

It would be nice if we could set the APPR_CONF_DIR (which is already there in the source code) per command line so that we can switch "context" between helm registry calls, e.g.:

It looks like it's not possible to use the environment variables APPR_CONF_DIR when using appr as Helm plugin (it's just ignored):

export APPR_CONF_DIR=.appr2 helm registry login -k -u -p

credentials are still stored in ~/.appr/auths.yaml

A command line flag for the registry plugin would solve this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/app-registry/appr/issues/61, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_vbOh5XkjbqaC9BdnqsXTZ1oiOvErfks5sUVuIgaJpZM4Or-Y6 .

sbueringer commented 7 years ago

This solution would be great, because we only would have to use one config folder for pushes in multiple organizations.

ant31 commented 7 years ago

@sbueringer

regarding this issue: I've just tried and worked:

export APPR_CONF_DIR=.appr2
helm registry login -k -u <user> -p <pw> <registry-url>
# credentials are stored in ~/.appr2/auths.yaml

Can you give another try?

sbueringer commented 7 years ago

@ant31 You're right it works. I'm not sure what went wrong the last time.

Would it still be possible to add a command-line option for this? (It's easier in our scripting to add command-line options then environment variables)

ant31 commented 7 years ago

@sbueringer yes, I'm closing this one.

I opened a new issue for the command-line option: #64