Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TA] change rolebinding create command parameter roles to comma-seperated #5166

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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