Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit 6e07d2d

Browse files
Merge pull request #166 from AzureArcForKubernetes/release-1.3.1
bump k8s-extension version to 1.3.1
2 parents 19c1598 + c8205ee commit 6e07d2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+51103
-31
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,6 @@
240240

241241
/src/change-analysis/ @linglingtong
242242

243+
/src/orbital/ @thisisdevanshu
244+
243245
/src/fluid-relay/ @kairu-ms @necusjz @ZengTaoxu

src/aks-preview/HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
* [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
15+
16+
0.5.93
17+
++++++
18+
19+
* Fix for "'Namespace' object has no attribute 'nodepool_name' error" in command `az aks nodepool wait`, see issue `\#23468 <https://github.com/Azure/azure-cli/issues/23468>`_.
1420

1521
0.5.92
1622
++++++

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -956,15 +956,15 @@
956956
examples:
957957
- name: Add a maintenance configuration with --weekday and --start-hour.
958958
text: |
959-
az aks maintenanceconfiguration add -g xiazhan-mtc-stg --cluster-name test1 -n default --weekday Monday --start-hour 1
959+
az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --weekday Monday --start-hour 1
960960
The maintenance is allowed on Monday 1:00am to 2:00am
961-
- name: Add a maintenance configuration with --weekday.The maintenance is allowd on any time of that day.
961+
- name: Add a maintenance configuration with --weekday. The maintenance is allowd on any time of that day.
962962
text: |
963-
az aks maintenanceconfiguration add -g xiazhan-mtc-stg --cluster-name test1 -n default --weekday Monday
963+
az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --weekday Monday
964964
The maintenance is allowed on Monday.
965965
- name: Add a maintenance configuration with maintenance configuration json file
966966
text: |
967-
az aks maintenanceconfiguration add -g xiazhan-mtc-stg --cluster-name test1 -n default --config-file ./test.json
967+
az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --config-file ./test.json
968968
The content of json file looks below. It means the maintenance is allowed on UTC time Tuesday 1:00am - 3:00 am and Wednesday 1:00am - 2:00am, 6:00am-7:00am
969969
No maintenance is allowed from 2020-11-26T03:00:00Z to 2020-11-30T12:00:00Z and from 2020-12-26T03:00:00Z to 2020-12-26T12:00:00Z even if they are allowed in the above weekly setting
970970
{
@@ -1013,15 +1013,15 @@
10131013
examples:
10141014
- name: Update a maintenance configuration with --weekday and --start-hour.
10151015
text: |
1016-
az aks maintenanceconfiguration update -g xiazhan-mtc-stg --cluster-name test1 -n default --weekday Monday --start-hour 1
1016+
az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --weekday Monday --start-hour 1
10171017
The maintenance is allowed on Monday 1:00am to 2:00am
10181018
- name: Update a maintenance configuration with --weekday.The maintenance is allowd on any time of that day.
10191019
text: |
1020-
az aks maintenanceconfiguration update -g xiazhan-mtc-stg --cluster-name test1 -n default --weekday Monday
1020+
az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --weekday Monday
10211021
The maintenance is allowed on Monday.
10221022
- name: Update a maintenance configuration with maintenance configuration json file
10231023
text: |
1024-
az aks maintenanceconfiguration update -g xiazhan-mtc-stg --cluster-name test1 -n default --config-file ./test.json
1024+
az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --config-file ./test.json
10251025
The content of json file looks below. It means the maintenance is allowed on UTC time Tuesday 1:00am - 3:00 am and Wednesday 1:00am - 2:00am, 6:00am-7:00am
10261026
No maintenance is allowed from 2020-11-26T03:00:00Z to 2020-11-30T12:00:00Z and from 2020-12-26T03:00:00Z to 2020-12-26T12:00:00Z even if they are allowed in the above weekly setting
10271027
{
@@ -1850,9 +1850,6 @@
18501850
- name: --roles
18511851
type: string
18521852
short-summary: Specify the space-separated roles.
1853-
- name: --source-resource-id -s
1854-
type: string
1855-
short-summary: Specify the source resource id of the binding.
18561853
"""
18571854

18581855
helps['aks trustedaccess rolebinding delete'] = """

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
validate_acr,
7676
validate_addon,
7777
validate_addons,
78+
validate_agent_pool_name,
7879
validate_apiserver_subnet_id,
7980
validate_assign_identity,
8081
validate_assign_kubelet_identity,
@@ -423,6 +424,8 @@ def load_arguments(self, _):
423424

424425
with self.argument_context('aks nodepool') as c:
425426
c.argument('cluster_name', help='The cluster name.')
427+
# the following argument is declared for the wait command
428+
c.argument('agent_pool_name', options_list=['--nodepool-name', '--agent-pool-name'], validator=validate_agent_pool_name, help='The node pool name.')
426429

427430
for sub_command in ['add', 'update', 'upgrade', 'scale', 'show', 'list', 'delete']:
428431
with self.argument_context('aks nodepool ' + sub_command) as c:
@@ -699,12 +702,12 @@ def load_arguments(self, _):
699702
c.argument('role_binding_name', options_list=[
700703
'--name', '-n'], required=True, help='The role binding name.')
701704

702-
for scope in ['aks trustedaccess rolebinding create', 'aks trustedaccess rolebinding update']:
703-
with self.argument_context(scope) as c:
704-
c.argument('roles', nargs='*',
705-
help='space-separated roles: Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer ...')
706-
c.argument('source_resource_id', options_list=['--source-resource-id', '-s'],
707-
help='The source resource id of the binding')
705+
with self.argument_context('aks trustedaccess rolebinding create') as c:
706+
c.argument('roles', nargs='*', help='space-separated roles: Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer ...')
707+
c.argument('source_resource_id', options_list=['--source-resource-id', '-s'], help='The source resource id of the binding')
708+
709+
with self.argument_context('aks trustedaccess rolebinding update') as c:
710+
c.argument('roles', nargs='*', help='space-separated roles: Microsoft.Demo/samples/reader Microsoft.Demo/samples/writer ...')
708711

709712

710713
def _get_default_install_location(exe_name):

src/aks-preview/azext_aks_preview/_validators.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,23 @@ def validate_ip_ranges(namespace):
138138
"--api-server-authorized-ip-ranges should be a list of IPv4 addresses or CIDRs")
139139

140140

141+
def _validate_nodepool_name(nodepool_name):
142+
"""Validates a nodepool name to be at most 12 characters, alphanumeric only."""
143+
if nodepool_name != "":
144+
if len(nodepool_name) > 12:
145+
raise InvalidArgumentValueError('--nodepool-name can contain at most 12 characters')
146+
if not nodepool_name.isalnum():
147+
raise InvalidArgumentValueError('--nodepool-name should contain only alphanumeric characters')
148+
149+
141150
def validate_nodepool_name(namespace):
142151
"""Validates a nodepool name to be at most 12 characters, alphanumeric only."""
143-
if namespace.nodepool_name != "":
144-
if len(namespace.nodepool_name) > 12:
145-
raise CLIError('--nodepool-name can contain atmost 12 characters')
146-
if not namespace.nodepool_name.isalnum():
147-
raise CLIError(
148-
'--nodepool-name should only contain alphanumeric characters')
152+
_validate_nodepool_name(namespace.nodepool_name)
153+
154+
155+
def validate_agent_pool_name(namespace):
156+
"""Validates a nodepool name to be at most 12 characters, alphanumeric only."""
157+
_validate_nodepool_name(namespace.agent_pool_name)
149158

150159

151160
def validate_vm_set_type(namespace):

src/aks-preview/azext_aks_preview/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,6 @@ def load_command_table(self, _):
199199
with self.command_group('aks trustedaccess rolebinding', trustedaccess_role_binding_sdk, client_factory=cf_trustedaccess_role_binding) as g:
200200
g.custom_command('list', 'aks_trustedaccess_role_binding_list')
201201
g.custom_show_command('show', 'aks_trustedaccess_role_binding_get')
202-
g.custom_command('create', 'aks_trustedaccess_role_binding_create_or_update')
203-
g.custom_command('update', 'aks_trustedaccess_role_binding_create_or_update')
202+
g.custom_command('create', 'aks_trustedaccess_role_binding_create')
203+
g.custom_command('update', 'aks_trustedaccess_role_binding_update')
204204
g.custom_command('delete', 'aks_trustedaccess_role_binding_delete', confirmation=True)

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,8 +2218,8 @@ def aks_trustedaccess_role_binding_get(cmd, client, resource_group_name, cluster
22182218
return client.get(resource_group_name, cluster_name, role_binding_name)
22192219

22202220

2221-
def aks_trustedaccess_role_binding_create_or_update(cmd, client, resource_group_name, cluster_name, role_binding_name,
2222-
source_resource_id, roles):
2221+
def aks_trustedaccess_role_binding_create(cmd, client, resource_group_name, cluster_name, role_binding_name,
2222+
source_resource_id, roles):
22232223
TrustedAccessRoleBinding = cmd.get_models(
22242224
"TrustedAccessRoleBinding",
22252225
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
@@ -2229,5 +2229,17 @@ def aks_trustedaccess_role_binding_create_or_update(cmd, client, resource_group_
22292229
return client.create_or_update(resource_group_name, cluster_name, role_binding_name, roleBinding)
22302230

22312231

2232+
def aks_trustedaccess_role_binding_update(cmd, client, resource_group_name, cluster_name, role_binding_name, roles):
2233+
TrustedAccessRoleBinding = cmd.get_models(
2234+
"TrustedAccessRoleBinding",
2235+
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
2236+
operation_group="trusted_access_role_bindings",
2237+
)
2238+
existedBinding = client.get(resource_group_name, cluster_name, role_binding_name)
2239+
2240+
roleBinding = TrustedAccessRoleBinding(source_resource_id=existedBinding.source_resource_id, roles=roles)
2241+
return client.create_or_update(resource_group_name, cluster_name, role_binding_name, roleBinding)
2242+
2243+
22322244
def aks_trustedaccess_role_binding_delete(cmd, client, resource_group_name, cluster_name, role_binding_name):
22332245
return client.delete(resource_group_name, cluster_name, role_binding_name)

src/aks-preview/azext_aks_preview/tests/latest/test_validators.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55
import unittest
6+
from types import SimpleNamespace
7+
68
from azure.cli.core.util import CLIError
79
from azure.cli.core.azclierror import InvalidArgumentValueError
810
import azext_aks_preview._validators as validators
@@ -408,5 +410,71 @@ def test_valid_azure_keyvault_kms_key_vault_resource_id(self):
408410
validators.validate_azure_keyvault_kms_key_vault_resource_id(namespace)
409411

410412

413+
class TestValidateNodepoolName(unittest.TestCase):
414+
def test_invalid_nodepool_name_too_long(self):
415+
namespace = SimpleNamespace(
416+
**{
417+
"nodepool_name": "tooLongNodepoolName",
418+
}
419+
)
420+
with self.assertRaises(InvalidArgumentValueError):
421+
validators.validate_nodepool_name(
422+
namespace
423+
)
424+
425+
def test_invalid_agent_pool_name_too_long(self):
426+
namespace = SimpleNamespace(
427+
**{
428+
"agent_pool_name": "tooLongNodepoolName",
429+
}
430+
)
431+
with self.assertRaises(InvalidArgumentValueError):
432+
validators.validate_agent_pool_name(
433+
namespace
434+
)
435+
436+
def test_invalid_nodepool_name_not_alnum(self):
437+
namespace = SimpleNamespace(
438+
**{
439+
"nodepool_name": "invalid-np*",
440+
}
441+
)
442+
with self.assertRaises(InvalidArgumentValueError):
443+
validators.validate_nodepool_name(
444+
namespace
445+
)
446+
447+
def test_invalid_agent_pool_name_not_alnum(self):
448+
namespace = SimpleNamespace(
449+
**{
450+
"agent_pool_name": "invalid-np*",
451+
}
452+
)
453+
with self.assertRaises(InvalidArgumentValueError):
454+
validators.validate_agent_pool_name(
455+
namespace
456+
)
457+
458+
def test_valid_nodepool_name(self):
459+
namespace = SimpleNamespace(
460+
**{
461+
"nodepool_name": "np100",
462+
}
463+
)
464+
validators.validate_nodepool_name(
465+
namespace
466+
)
467+
468+
def test_valid_agent_pool_name(self):
469+
namespace = SimpleNamespace(
470+
**{
471+
"agent_pool_name": "np100",
472+
}
473+
)
474+
validators.validate_agent_pool_name(
475+
namespace
476+
)
477+
478+
411479
if __name__ == "__main__":
412480
unittest.main()

src/aks-preview/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from setuptools import setup, find_packages
1111

12-
VERSION = "0.5.92"
12+
VERSION = "0.5.93"
1313
CLASSIFIERS = [
1414
"Development Status :: 4 - Beta",
1515
"Intended Audience :: Developers",

src/azure-firewall/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
0.14.2
6+
++++++
7+
* `az network firewall create/update`: add parameter `--fat-flow-logging`
8+
59
0.14.1
610
++++++
711
* `az network firewall policy`: add parameter `sql`

0 commit comments

Comments
 (0)