Skip to content

Commit 0726e81

Browse files
flavianmissiopenshift-cherrypick-robot
authored andcommitted
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 d139e6b commit 0726e81

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
@@ -366,10 +366,10 @@ func validate(opts *configOpts) error {
366366
if len(opts.clientSecret) == 0 && len(opts.federatedTokenFile) == 0 && len(opts.accountKey) == 0 {
367367
return fmt.Errorf("One of AZURE_CLIENT_SECRET or AZURE_FEDERATED_TOKEN_FILE or AZURE_ACCOUNTKEY is required for authentication")
368368
}
369-
if len(opts.clientID) == 0 {
369+
if len(opts.clientID) == 0 && len(opts.accountKey) == 0 {
370370
return fmt.Errorf("AZURE_CLIENT_ID is required for authentication")
371371
}
372-
if len(opts.tenantID) == 0 {
372+
if len(opts.tenantID) == 0 && len(opts.accountKey) == 0 {
373373
return fmt.Errorf("AZURE_TENANT_ID is required for authentication")
374374
}
375375
if len(opts.storageAccountName) == 0 {

0 commit comments

Comments
 (0)