Skip to content

Commit 33e12d3

Browse files
authored
Merge pull request #2905 from k8s-infra-cherrypick-robot/cherry-pick-2903-to-release-1.33
[release-1.33] fix: allow uppercase subscription ID
2 parents 33de4d5 + 5e47ed4 commit 33e12d3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/azurefile/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func getFileServiceURL(accountName, storageEndpointSuffix string) string {
360360
}
361361

362362
func isValidSubscriptionID(subsID string) bool {
363-
return regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`).MatchString(subsID)
363+
return regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`).MatchString(subsID)
364364
}
365365

366366
// RemoveOptionIfExists removes the given option from the list of options

pkg/azurefile/utils_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,11 @@ func TestIsValidSubscriptionID(t *testing.T) {
10711071
subsID: "2025-04-15T11:06:21.0000000Z",
10721072
expected: false,
10731073
},
1074+
{
1075+
desc: "valid subscription ID - uppercase letters",
1076+
subsID: "C9D2281E-DCD5-4DFD-9A97-0D50377CDF76",
1077+
expected: true,
1078+
},
10741079
}
10751080

10761081
for _, test := range tests {

0 commit comments

Comments
 (0)