Skip to content
Merged
5 changes: 5 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

0.5.72
Comment thread
YitongFeng-git marked this conversation as resolved.
Outdated
++++++

* Add command `aks trustedaccess role list`.

0.5.71
++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"test_aks_create_and_update_with_http_proxy_config",
"test_aks_snapshot",
"test_aks_custom_kubelet_identity",
"test_aks_nodepool_add_with_ossku_windows2022"
"test_aks_nodepool_add_with_ossku_windows2022",
"test_list_trustedaccess_roles"
]
}
}
4 changes: 4 additions & 0 deletions src/aks-preview/azext_aks_preview/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def get_container_service_client(cli_ctx, **_):
return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW)


def cf_trustedaccess_role(cli_ctx, *_):
return get_container_service_client(cli_ctx).trusted_access_roles
Comment thread
YitongFeng-git marked this conversation as resolved.


def cf_container_services(cli_ctx, *_):
return get_container_service_client(cli_ctx).container_services

Expand Down
15 changes: 15 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,3 +1704,18 @@
type: command
short-summary: Delete a nodepool snapshot.
"""

helps['aks trustedaccess'] = """
type: group
short-summary: Commands to manage trusted access security features.
"""

helps['aks trustedaccess role'] = """
type: group
short-summary: Commands to manage trusted access roles.
"""

helps['aks trustedaccess role list'] = """
type: command
short-summary: List trusted access roles.
"""
14 changes: 13 additions & 1 deletion src/aks-preview/azext_aks_preview/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ._client_factory import cf_agent_pools
from ._client_factory import cf_nodepool_snapshots
from ._client_factory import cf_mc_snapshots
from ._client_factory import cf_trustedaccess_role
from ._format import aks_show_table_format
from ._format import aks_addon_list_available_table_format, aks_addon_list_table_format, aks_addon_show_table_format
from ._format import aks_agentpool_show_table_format
Expand Down Expand Up @@ -54,7 +55,14 @@ def load_command_table(self, _):
mc_snapshot_sdk = CliCommandType(
operations_tmpl='azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks.'
'operations._managed_clusters_snapshots_operations#ManagedClusterSnapshotsOperations.{}',
client_factory=cf_mc_snapshots)
client_factory=cf_mc_snapshots
)

trustedaccess_role_sdk = CliCommandType(
operations_tmpl='azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks.'
'operations._trusted_access_roles_operations#TrustedAccessRolesOperations.{}',
client_factory=cf_trustedaccess_role
)

# AKS managed cluster commands
with self.command_group('aks', managed_clusters_sdk, client_factory=cf_managed_clusters) as g:
Expand Down Expand Up @@ -162,3 +170,7 @@ def load_command_table(self, _):
supports_no_wait=True)
g.custom_command('delete', 'aks_snapshot_delete',
supports_no_wait=True)

# AKS trusted access roles commands
with self.command_group('aks trustedaccess role', trustedaccess_role_sdk, client_factory=cf_trustedaccess_role) as g:
g.custom_command('list', 'aks_trustedaccess_role_list')
4 changes: 4 additions & 0 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3175,3 +3175,7 @@ def aks_nodepool_snapshot_list(cmd, client, resource_group_name=None): # pylint
return client.list()

return client.list_by_resource_group(resource_group_name)


def aks_trustedaccess_role_list(cmd, client, location): # pylint: disable=unused-argument
return client.list(location)
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def test_aks_create_with_openservicemesh_addon(self, resource_group, resource_gr
self.check('addonProfiles.openServiceMesh.enabled', True),
])

@live_only() # live only is required for test environment setup like `az login`
@live_only() # live only is required for test environment setup like `az login`
@AllowLargeResponse()
def test_aks_addon_list_available(self):
list_available_cmd = 'aks addon list-available -o json'
Expand Down Expand Up @@ -1378,10 +1378,10 @@ def test_aks_nodepool_add_with_ossku_windows2022(self, resource_group, resource_
'--node-count=1 '
'--os-type Windows '
'--os-sku Windows2022',
checks=[
self.check('provisioningState', 'Succeeded'),
self.check('osSku', 'Windows2022'),
])
checks=[
self.check('provisioningState', 'Succeeded'),
self.check('osSku', 'Windows2022'),
])

# delete
self.cmd(
Expand Down Expand Up @@ -4065,8 +4065,7 @@ def test_aks_create_and_update_with_csi_drivers_extensibility(self, resource_gro

# check standard reconcile scenario
update_cmd = 'aks update --resource-group={resource_group} --name={name} -y -o json'
self.cmd(update_cmd
, checks=[
self.cmd(update_cmd, checks=[
self.check('provisioningState', 'Succeeded'),
self.check('storageProfile.diskCsiDriver.enabled', False),
self.check('storageProfile.fileCsiDriver.enabled', False),
Expand All @@ -4086,8 +4085,7 @@ def test_aks_create_and_update_with_csi_drivers_extensibility(self, resource_gro

# check standard reconcile scenario
update_cmd = 'aks update --resource-group={resource_group} --name={name} -y -o json'
self.cmd(update_cmd
, checks=[
self.cmd(update_cmd, checks=[
self.check('provisioningState', 'Succeeded'),
self.check('storageProfile.diskCsiDriver.enabled', True),
self.check('storageProfile.fileCsiDriver.enabled', True),
Expand Down Expand Up @@ -4174,3 +4172,13 @@ def test_aks_create_with_apiserver_vnet_integration(self, resource_group, resour
self.cmd(cmd, checks=[
self.is_empty(),
])


@live_only() # live only is required for test environment setup like `az login`
Comment thread
YitongFeng-git marked this conversation as resolved.
Outdated
@AllowLargeResponse()
def test_list_trustedaccess_roles(self):
cmd = 'aks trustedaccess role list -l eastus2euap'
self.cmd(cmd, checks=[
self.check(
'type', 'Microsoft.ContainerService/locations/trustedaccessroles')
])