Skip to content

Commit 6dcff1f

Browse files
committed
azure-path-fix: fix validation for move-blobs command
our validation was incorrect - when account key is given client and tenant ids are not required
1 parent d87f0c7 commit 6dcff1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/move-blobs/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ func validate(opts *configOpts) error {
367367
if len(opts.clientSecret) == 0 && len(opts.federatedTokenFile) == 0 && len(opts.accountKey) == 0 {
368368
return fmt.Errorf("One of AZURE_CLIENT_SECRET or AZURE_FEDERATED_TOKEN_FILE or AZURE_ACCOUNTKEY is required for authentication")
369369
}
370-
if len(opts.clientID) == 0 {
370+
if len(opts.clientID) == 0 && len(opts.accountKey) == 0 {
371371
return fmt.Errorf("AZURE_CLIENT_ID is required for authentication")
372372
}
373-
if len(opts.tenantID) == 0 {
373+
if len(opts.tenantID) == 0 && len(opts.accountKey) == 0 {
374374
return fmt.Errorf("AZURE_TENANT_ID is required for authentication")
375375
}
376376
if len(opts.storageAccountName) == 0 {

0 commit comments

Comments
 (0)