Skip to content

vm/vmss: use patch for updating identities#6269

Merged
yugangw-msft merged 7 commits into
Azure:devfrom
yugangw-msft:msipatch
May 1, 2018
Merged

vm/vmss: use patch for updating identities#6269
yugangw-msft merged 7 commits into
Azure:devfrom
yugangw-msft:msipatch

Conversation

@yugangw-msft
Copy link
Copy Markdown
Contributor

(Not for //build release)
The main purpose is to by-pass the access check on linked resources which otherwise would block the whole operation e.g. if the users has access to the VMSS, but not on the LB.

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@promptws
Copy link
Copy Markdown

View a preview at https://prompt.ws/r/Azure/azure-cli/6269
This is an experimental preview for @microsoft users.

@derekbekoe derekbekoe added this to the Sprint 37 milestone Apr 30, 2018

vm.identity = VirtualMachineIdentity(type=identity_types)
if external_identities:
external_identities[::] = set(external_identities)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what's the difference between this and external_identities = list(set(external_identities))?
why not combine with next line make it

vm.identity.identity_ids = list(set(external_identities))

Copy link
Copy Markdown
Contributor Author

@yugangw-msft yugangw-msft May 1, 2018

Choose a reason for hiding this comment

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

It is in-place copy so to propagate the same data to outside through argument passing-by-ref, and gets picked up by the main method to display the result.
Let me add comment here to clarify the subtleness

vmss.identity = VirtualMachineScaleSetIdentity(type=identity_types)
if external_identities:
external_identities[::] = set(external_identities)
vmss.identity.identity_ids = external_identities
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same, will add comment

@yugangw-msft yugangw-msft merged commit 874e45c into Azure:dev May 1, 2018
@yugangw-msft yugangw-msft deleted the msipatch branch May 1, 2018 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants