Skip to content
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
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def default_api_version(self):
ResourceType.MGMT_ARO: '2023-11-22',
ResourceType.MGMT_DATABOXEDGE: '2021-02-01-preview',
ResourceType.MGMT_CUSTOMLOCATION: '2021-03-15-preview',
ResourceType.MGMT_CONTAINERSERVICE: SDKProfile('2025-05-01'),
ResourceType.MGMT_CONTAINERSERVICE: None,
ResourceType.MGMT_APPCONTAINERS: '2022-10-01',
}
}
Expand Down
10 changes: 0 additions & 10 deletions src/azure-cli/azure/cli/command_modules/acs/_completers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ def get_k8s_versions(cli_ctx, location):
return search("values[*].patchVersions.keys(@)[]", results)


@Completer
def get_vm_size_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument
"""Return the intersection of the VM sizes allowed by the ACS SDK with those returned by the Compute Service."""
from azure.mgmt.containerservice.models import ContainerServiceVMSizeTypes

location = _get_location(cmd.cli_ctx, namespace)
result = get_vm_sizes(cmd.cli_ctx, location)
return set(r.name for r in result) & set(c.value for c in ContainerServiceVMSizeTypes)


def get_vm_sizes(cli_ctx, location):
from azure.cli.command_modules.acs._client_factory import get_compute_client

Expand Down
7 changes: 3 additions & 4 deletions src/azure-cli/azure/cli/command_modules/acs/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

from argcomplete.completers import FilesCompleter
from azure.cli.command_modules.acs._completers import (
get_k8s_upgrades_completion_list, get_k8s_versions_completion_list,
get_vm_size_completion_list)
get_k8s_upgrades_completion_list, get_k8s_versions_completion_list)
from azure.cli.command_modules.acs._consts import (
CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PRIVATE,
CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PUBLIC,
Expand Down Expand Up @@ -460,7 +459,7 @@ def load_arguments(self, _):
# nodepool paramerters
c.argument('nodepool_name', default='nodepool1',
help='Node pool name, up to 12 alphanumeric characters', validator=validate_nodepool_name)
c.argument('node_vm_size', options_list=['--node-vm-size', '-s'], completer=get_vm_size_completion_list)
c.argument('node_vm_size', options_list=['--node-vm-size', '-s'])
c.argument('vm_sizes')
c.argument('os_sku', arg_type=get_enum_type(node_os_skus_create), validator=validate_os_sku)
c.argument('snapshot_id', validator=validate_snapshot_id)
Expand Down Expand Up @@ -891,7 +890,7 @@ def load_arguments(self, _):
c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', c.deprecate(target='--agent-pool-name', redirect='--nodepool-name', hide=True)], validator=validate_agent_pool_name, help='The node pool name.')

with self.argument_context('aks nodepool add') as c:
c.argument('node_vm_size', options_list=['--node-vm-size', '-s'], completer=get_vm_size_completion_list)
c.argument('node_vm_size', options_list=['--node-vm-size', '-s'])
c.argument('vm_sizes')
c.argument('vm_set_type', validator=validate_vm_set_type)
c.argument('os_type')
Expand Down
8 changes: 4 additions & 4 deletions src/azure-cli/azure/cli/command_modules/acs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def load_command_table(self, _):
confirmation='Kubernetes will be unavailable during certificate rotation process.\n' +
'Are you sure you want to perform this operation?')
g.custom_command('stop', 'aks_stop',
Copy link

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

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

The 'stop' command performs a potentially dangerous operation that will make Kubernetes unavailable. Consider adding confirmation=True parameter to ensure users confirm this action.

Copilot uses AI. Check for mistakes.
supports_no_wait=True, min_api='2020-09-01')
supports_no_wait=True)
g.command('start', 'begin_start',
supports_no_wait=True, min_api='2020-09-01')
supports_no_wait=True)
g.wait_command('wait')
g.custom_command('use-dev-spaces', 'aks_use_dev_spaces',
deprecate_info=g.deprecate())
Expand Down Expand Up @@ -188,7 +188,7 @@ def load_command_table(self, _):
client_factory=cf_snapshots,
deprecate_info=self.deprecate(
redirect='aks nodepool snapshot', hide=True),
min_api='2021-08-01') as g:
) as g:
g.custom_command('list', 'aks_nodepool_snapshot_list',
deprecate_info=g.deprecate(
redirect='aks nodepool snapshot list'),
Expand All @@ -207,7 +207,7 @@ def load_command_table(self, _):
with self.command_group('aks nodepool snapshot',
snapshot_sdk,
client_factory=cf_snapshots,
min_api='2021-08-01') as g:
) as g:
g.custom_command('list', 'aks_nodepool_snapshot_list',
table_transformer=aks_list_nodepool_snapshot_table_format)
g.custom_show_command('show', 'aks_nodepool_snapshot_show',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ def setUp(self):

def test__init__(self):
# load models directly (instead of through the `get_sdk` method provided by the cli component)
from azure.cli.core.profiles._shared import AZURE_API_PROFILES

sdk_profile = AZURE_API_PROFILES["latest"][self.resource_type]
api_version = sdk_profile.default_api_version
module_name = "azure.mgmt.containerservice.v{}.models".format(api_version.replace("-", "_"))
module_name = "azure.mgmt.containerservice.models"
module = importlib.import_module(module_name)

standalone_models = AKSAgentPoolModels(self.cmd, self.resource_type, AgentPoolDecoratorMode.STANDALONE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ def setUp(self):

def test_models(self):
# load models directly (instead of through the `get_sdk` method provided by the cli component)
from azure.cli.core.profiles._shared import AZURE_API_PROFILES

sdk_profile = AZURE_API_PROFILES["latest"][ResourceType.MGMT_CONTAINERSERVICE]
api_version = sdk_profile.default_api_version
module_name = "azure.mgmt.containerservice.v{}.models".format(api_version.replace("-", "_"))
module_name = "azure.mgmt.containerservice.models"
module = importlib.import_module(module_name)

models = BaseAKSModels(self.cmd, ResourceType.MGMT_CONTAINERSERVICE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ def test_models(self):
models = AKSManagedClusterModels(self.cmd, ResourceType.MGMT_CONTAINERSERVICE)

# load models directly (instead of through the `get_sdk` method provided by the cli component)
from azure.cli.core.profiles._shared import AZURE_API_PROFILES

sdk_profile = AZURE_API_PROFILES["latest"][ResourceType.MGMT_CONTAINERSERVICE]
api_version = sdk_profile.default_api_version
module_name = "azure.mgmt.containerservice.v{}.models".format(api_version.replace("-", "_"))
module_name = "azure.mgmt.containerservice.models"
module = importlib.import_module(module_name)

# load balancer models
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ azure-mgmt-cognitiveservices==13.5.0
azure-mgmt-compute==34.1.0
azure-mgmt-containerinstance==10.2.0b1
azure-mgmt-containerregistry==14.1.0b1
azure-mgmt-containerservice==38.0.0
azure-mgmt-containerservice==39.0.0
azure-mgmt-core==1.6.0
azure-mgmt-cosmosdb==9.8.0
azure-mgmt-databoxedge==1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ azure-mgmt-cognitiveservices==13.5.0
azure-mgmt-compute==34.1.0
azure-mgmt-containerinstance==10.2.0b1
azure-mgmt-containerregistry==14.1.0b1
azure-mgmt-containerservice==38.0.0
azure-mgmt-containerservice==39.0.0
azure-mgmt-core==1.6.0
azure-mgmt-cosmosdb==9.8.0
azure-mgmt-databoxedge==1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ azure-mgmt-cognitiveservices==13.5.0
azure-mgmt-compute==34.1.0
azure-mgmt-containerinstance==10.2.0b1
azure-mgmt-containerregistry==14.1.0b1
azure-mgmt-containerservice==38.0.0
azure-mgmt-containerservice==39.0.0
azure-mgmt-core==1.6.0
azure-mgmt-cosmosdb==9.8.0
azure-mgmt-databoxedge==1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
'azure-mgmt-compute~=34.1.0',
'azure-mgmt-containerinstance==10.2.0b1',
'azure-mgmt-containerregistry==14.1.0b1',
'azure-mgmt-containerservice~=38.0.0',
'azure-mgmt-containerservice~=39.0.0',
'azure-mgmt-cosmosdb==9.8.0',
'azure-mgmt-databoxedge~=1.0.0',
'azure-mgmt-datalake-store~=1.1.0b1',
Expand Down
Loading