Skip to content

Commit

Permalink
[TA] change rolebinding create command parameter roles to comma-seper…
Browse files Browse the repository at this point in the history
…ated (#5166)
  • Loading branch information
YitongFeng-git authored Aug 18, 2022
1 parent 07f6630 commit 1653739
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++
* [BREAKING CHANGE] Since the service no longer supports updating source resource id for role binding, so remove --source-resource-id of `aks trustedaccess rolebinding update` command
* change rolebinding create command parameter roles to comma-seperated

0.5.93
++++++
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@
examples:
- name: Create a new trusted access role binding
text: az aks trustedaccess rolebinding create -g myResourceGroup --cluster-name myCluster -n bindingName -s /subscriptions/0000/resourceGroups/myResourceGroup/providers/Microsoft.Demo/samples --roles Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer
text: az aks trustedaccess rolebinding create -g myResourceGroup --cluster-name myCluster -n bindingName -s /subscriptions/0000/resourceGroups/myResourceGroup/providers/Microsoft.Demo/samples --roles Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer
"""

helps['aks trustedaccess rolebinding update'] = """
Expand Down
4 changes: 2 additions & 2 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,11 @@ def load_arguments(self, _):
'--name', '-n'], required=True, help='The role binding name.')

with self.argument_context('aks trustedaccess rolebinding create') as c:
c.argument('roles', nargs='*', help='space-separated roles: Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer ...')
c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...')
c.argument('source_resource_id', options_list=['--source-resource-id', '-s'], help='The source resource id of the binding')

with self.argument_context('aks trustedaccess rolebinding update') as c:
c.argument('roles', nargs='*', help='space-separated roles: Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer ...')
c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...')


def _get_default_install_location(exe_name):
Expand Down
3 changes: 2 additions & 1 deletion src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,8 @@ def aks_trustedaccess_role_binding_create(cmd, client, resource_group_name, clus
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
operation_group="trusted_access_role_bindings",
)
roleBinding = TrustedAccessRoleBinding(source_resource_id=source_resource_id, roles=roles)
roleList = roles.split(',')
roleBinding = TrustedAccessRoleBinding(source_resource_id=source_resource_id, roles=roleList)
return client.create_or_update(resource_group_name, cluster_name, role_binding_name, roleBinding)


Expand Down

0 comments on commit 1653739

Please sign in to comment.