Skip to content

Commit

Permalink
Update azure_privatecluster.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed Jun 8, 2022
1 parent b2a8035 commit f02e81b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/e2e/azure_privatecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,14 @@ func getClientIDforMSI(resourceID string) string {
authorizer, err := settings.GetAuthorizer()
Expect(err).NotTo(HaveOccurred())

msi := msi.NewUserAssignedIdentitiesClient(subscriptionID, authorizer)
msi.Authorizer = authorizer
msiClient := msi.NewUserAssignedIdentitiesClient(subscriptionID)
msiClient.Authorizer = authorizer

client := identities.AzureClient{msi}
parsed, err := azuresdk.ParseResourceID(resourceID)
Expect(err).NotTo(HaveOccurred())

clientID, err := client.GetClientID(context.Background(), resourceID)
id, err := msiClient.Get(context.TODO(), parsed.ResourceGroup, parsed.ResourceName)
Expect(err).NotTo(HaveOccurred())

return clientID
return id.ClientID.String()
}

0 comments on commit f02e81b

Please sign in to comment.