From 225fb2a1941fa6cde2388a74a490cfbe70a684aa Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Thu, 15 Nov 2018 17:23:15 -0800 Subject: [PATCH] *string needs nil guard --- pkg/operations/deletevm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/operations/deletevm.go b/pkg/operations/deletevm.go index 375a1e9574..5f995fb83b 100644 --- a/pkg/operations/deletevm.go +++ b/pkg/operations/deletevm.go @@ -90,7 +90,7 @@ func CleanDeleteVirtualMachine(az armhelpers.AKSEngineClient, logger *log.Entry, } } - if vm.Identity != nil { + if vm.Identity != nil && vm.Identity.PrincipalID != nil { // Role assignments are not deleted if the VM is destroyed, so we must cleanup ourselves! // The role assignments should only be relevant if managed identities are used, // but always cleaning them up is easier than adding rule based logic here and there.