goharbor / harbor-cli

[Sandbox] Official Harbor CLI
Apache License 2.0
42 stars 45 forks source link

Config flag error ignored during login #251

Closed franklinkim closed 3 hours ago

franklinkim commented 1 week ago

Version

harbor-cli v0.0.1

Issue

When trying to login with a --config my/config.yaml flag, it still tries to store the credentials in the default location:

$ harbor --config my/config.yaml login $SERVER -u $USER
Error: failed to store the credential: stat $HOME/.harbor/config.yaml: no such file or directory

Also, would be nice to also check for $HOME/.config/harbor/config.yaml and make it possible to override it through an environment variable e.g. like HARBOR_CLI_CONFIG=my/config.yaml