Skip to content

Commit bcf5cc7

Browse files
ignore casing for MC prefix (#536)
1 parent e23b8ee commit bcf5cc7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/azure/azure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func ConvertToClusterResourceGroup(subscriptionID SubscriptionID, resourceGroup
4141
}
4242

4343
split := strings.Split(string(resourceGroup), "_")
44-
if len(split) != 4 || split[0] != "MC" {
44+
if len(split) != 4 || strings.ToUpper(split[0]) != "MC" {
4545
logLine := fmt.Sprintf("infrastructure resource group name: %s is expected to be of format MC_ResourceGroup_ResourceName_Location", string(resourceGroup))
4646
return "", errors.New(logLine)
4747
}

pkg/azure/azure_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ var _ = Describe("Azure", func() {
4545
subID := SubscriptionID("xxxx")
4646
resGp := ResourceGroup("MC_resgp_resName_location")
4747
Expect(ConvertToClusterResourceGroup(subID, resGp, nil)).To(Equal("/subscriptions/xxxx/resourcegroups/resgp/providers/Microsoft.ContainerService/managedClusters/resName"))
48+
49+
subID = SubscriptionID("xxxx")
50+
resGp = ResourceGroup("mc_resgp_resName_location")
51+
Expect(ConvertToClusterResourceGroup(subID, resGp, nil)).To(Equal("/subscriptions/xxxx/resourcegroups/resgp/providers/Microsoft.ContainerService/managedClusters/resName"))
4852
})
4953
})
5054
})

0 commit comments

Comments
 (0)