Skip to content

Commit 3a13196

Browse files
authored
Merge pull request #2903 from kubernetes-sigs/allow-subsid-uppercase
fix: allow uppercase subscription ID
2 parents c2b135f + d6e94bf commit 3a13196

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
@@ -361,7 +361,7 @@ func getFileServiceURL(accountName, storageEndpointSuffix string) string {
361361
}
362362

363363
func isValidSubscriptionID(subsID string) bool {
364-
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)
364+
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)
365365
}
366366

367367
// 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)