Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Fix assigned id deletion when no identity exists #320

Merged
merged 2 commits into from
Aug 2, 2019

Conversation

aramase
Copy link
Member

@aramase aramase commented Jul 30, 2019

Reason for Change:

When the last underlying identity is deleted from the node, the deletion of assigned identity fails because the resource type is not set during the CreateOrUpdate call. This PR ensures when the identity list is nil, the resource type is set to None.

Adds e2e test to valid the scenario.

Issue Fixed:

Fixes #313

Notes for Reviewers:

@@ -105,6 +105,10 @@ func (i *vmIdentityInfo) RemoveUserIdentity(id string) error {
if i.info.Type == compute.ResourceIdentityTypeNone || i.info.Type == compute.ResourceIdentityTypeSystemAssigned {
i.info.IdentityIds = nil
}
// if the identityids is nil and identity type is not set, then set it to ResourceIdentityTypeNone
if i.info.IdentityIds == nil && i.info.Type == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking more here, shouldn't we just skip the call to cloud overall in this scenario ?

@aramase
Copy link
Member Author

aramase commented Aug 2, 2019

Ran 15 of 16 Specs in 3024.197 seconds
SUCCESS! -- 15 Passed | 0 Failed | 0 Pending | 1 Skipped
--- PASS: TestAADPodIdentity (3024.20s)
PASS
ok  	github.com/Azure/aad-pod-identity/test/e2e	3024.220s

@aramase aramase changed the title [WIP] Fix assigned id deletion when no identity exists Fix assigned id deletion when no identity exists Aug 2, 2019
@kkmsft kkmsft merged commit bbe1a76 into Azure:master Aug 2, 2019
@aramase aramase deleted the fix-failover-bug branch August 2, 2019 20:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failover causing further azure operations to fail
2 participants