mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-21 14:46:07 +00:00
Make GCP credentials parsing errors less ambiguous (#1850)
A user encountered the following error on a GCP project: An error occurred: some backup storage locations are invalid: error getting backup store for location "default": rpc error: code = Unknown desc = invalid character '-' in numeric literal This error was ambiguous and took some time to track down to the fact that their credentials file wasn't a JSON file, but instead the contents of the private key field. This change makes the problem slightly easier to debug. Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
committed by
Steve Kriss
parent
1e88e47b93
commit
8da9ef2b03
@@ -83,7 +83,7 @@ func (o *ObjectStore) Init(config map[string]string) error {
|
||||
}
|
||||
jwtConfig, err := google.JWTConfigFromJSON(creds)
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
return errors.Wrap(err, "error parsing credentials file; should be JSON")
|
||||
}
|
||||
if jwtConfig.Email == "" {
|
||||
return errors.Errorf("credentials file pointed to by %s does not contain an email", credentialsEnvVar)
|
||||
|
||||
Reference in New Issue
Block a user