Skip to content

Commit

Permalink
case-insensitive managed identity check
Browse files Browse the repository at this point in the history
  • Loading branch information
kon-angelo committed Jul 20, 2021
1 parent 8f82e4e commit 1c1ee15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/integration/infrastructure/infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"flag"
"fmt"
"path/filepath"
"strings"
"time"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-30/compute"
Expand Down Expand Up @@ -907,7 +908,11 @@ func verifyCreation(

Expect(id.Name).To(PointTo(Equal(config.Identity.Name)))
Expect(status.Identity).ToNot(BeNil())
Expect(status.Identity.ID).To(Equal(*id.ID))

// This is a case-insensitive check to determine if the resouce IDs match. In some cases Azure would respond with
// different cases in certain parts of the ID string (e.g. resourceGroups vs resourcegroups). IDs in Azure however seem to not take
// case into account, hence we can safely check with EqualFold.
Expect(strings.EqualFold(status.Identity.ID, *id.ID)).To(BeTrue())
Expect(status.Identity.ClientID).To(Equal(id.ClientID.String()))
}

Expand Down

0 comments on commit 1c1ee15

Please sign in to comment.