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

update identity in vmss only once #379

Merged
merged 8 commits into from
Sep 17, 2019
Merged

update identity in vmss only once #379

merged 8 commits into from
Sep 17, 2019

Conversation

aramase
Copy link
Member

@aramase aramase commented Sep 11, 2019

Reason for Change:

Update identity in vmss only once as identity is across all nodes in vmss and not just single node.

Issue Fixed:

Fixes #361

Notes for Reviewers:

@aramase
Copy link
Member Author

aramase commented Sep 12, 2019

Ran 19 of 19 Specs in 4697.501 seconds
SUCCESS! -- 19 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestAADPodIdentity (4697.43s)
PASS
ok  	github.com/Azure/aad-pod-identity/test/e2e	4697.501s

@@ -96,6 +96,11 @@ func makeVMSSID(r azure.Resource) string {
return path.Join(r.SubscriptionID, r.ResourceGroup, r.ResourceName)
}

func getVMSSName(vmssID string) string {
_, resourceName := path.Split(vmssID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to have an erroneous vmssID, if so how do we handle this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

If the vmssID is erroneous, then we fail while trying to create the client and not perform any operations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please handle the error for the path.Split returning an empty string ?

pkg/mic/mic.go Show resolved Hide resolved
pkg/mic/mic.go Show resolved Hide resolved
pkg/mic/mic.go Outdated Show resolved Hide resolved
pkg/mic/mic.go Outdated Show resolved Hide resolved
pkg/mic/mic.go Show resolved Hide resolved
pkg/mic/mic.go Outdated Show resolved Hide resolved
wg.Add(1)
// node is no longer found in the cluster, all the assigned identities that were created in this sync loop
// and those that already exist for this node need to be deleted.
go c.cleanUpAllAssignedIdentitiesOnNode(nodeName, nodeTrackList, wg)
Copy link
Contributor

Choose a reason for hiding this comment

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

If we use anonymous function, we don't have to pass wg to cleanUpAllAssignedIdentitiesOnNode. Is that idiomatic way to use ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm passing the same wg for consolidating vmss node (which perform the cleanup if reqd) and update node deps. That way all our processing is done async.

pkg/mic/mic.go Show resolved Hide resolved
Copy link
Contributor

@kkmsft kkmsft left a comment

Choose a reason for hiding this comment

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

/lgtm - few nits.

@aramase aramase changed the title [WIP] update identity in vmss only once update identity in vmss only once Sep 17, 2019
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.

Update identities on VMSS only once
2 participants