Skip to content

Commit 57a76fa

Browse files
lotheacleonardoce
authored andcommitted
fix: misleading message about Azure if no ObjectStore credentials defined
if all of azureCredentials, googleCredentials and s3Credentials are nil, the resulting error message says "missing Azure credentials", which is misleading. add a specific error message for this case. Signed-off-by: Lauri Tirkkonen <lauri@hacktheplanet.fi>
1 parent e89e4ac commit 57a76fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/credentials/env.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ func envSetCloudCredentials(
118118
return envSetGoogleCredentials(ctx, c, namespace, configuration.Google, env)
119119
}
120120

121-
return envSetAzureCredentials(ctx, c, namespace, configuration, env)
121+
if configuration.Azure != nil {
122+
return envSetAzureCredentials(ctx, c, namespace, configuration, env)
123+
}
124+
125+
return nil, fmt.Errorf("ObjectStoreConfiguration invalid: no credentials defined")
122126
}
123127

124128
// envSetAWSCredentials sets the AWS environment variables given the configuration

0 commit comments

Comments
 (0)