Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 0449af5

Browse files
committed
*string PrincipalID needs to be nil-guarded (#4258)
1 parent 1b07ace commit 0449af5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/operations/deletevm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func CleanDeleteVirtualMachine(az armhelpers.ACSEngineClient, logger *log.Entry,
9090
}
9191
}
9292

93-
if vm.Identity != nil {
93+
if vm.Identity != nil && vm.Identity.PrincipalID != nil {
9494
// Role assignments are not deleted if the VM is destroyed, so we must cleanup ourselves!
9595
// The role assignments should only be relevant if managed identities are used,
9696
// but always cleaning them up is easier than adding rule based logic here and there.

0 commit comments

Comments
 (0)