Skip to content

Commit

Permalink
ignore casing for MC prefix (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaysngupta authored Sep 17, 2019
1 parent e23b8ee commit bcf5cc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func ConvertToClusterResourceGroup(subscriptionID SubscriptionID, resourceGroup
}

split := strings.Split(string(resourceGroup), "_")
if len(split) != 4 || split[0] != "MC" {
if len(split) != 4 || strings.ToUpper(split[0]) != "MC" {
logLine := fmt.Sprintf("infrastructure resource group name: %s is expected to be of format MC_ResourceGroup_ResourceName_Location", string(resourceGroup))
return "", errors.New(logLine)
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/azure/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ var _ = Describe("Azure", func() {
subID := SubscriptionID("xxxx")
resGp := ResourceGroup("MC_resgp_resName_location")
Expect(ConvertToClusterResourceGroup(subID, resGp, nil)).To(Equal("/subscriptions/xxxx/resourcegroups/resgp/providers/Microsoft.ContainerService/managedClusters/resName"))

subID = SubscriptionID("xxxx")
resGp = ResourceGroup("mc_resgp_resName_location")
Expect(ConvertToClusterResourceGroup(subID, resGp, nil)).To(Equal("/subscriptions/xxxx/resourcegroups/resgp/providers/Microsoft.ContainerService/managedClusters/resName"))
})
})
})
Expand Down

0 comments on commit bcf5cc7

Please sign in to comment.