-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[ARO] downstream extension #33912
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
Merged
Cooper Cox (coopercox-ms)
merged 12 commits into
Azure:dev
from
komidore64:aro-9894-downstream-extension
Aug 21, 2026
Merged
[ARO] downstream extension #33912
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dad3d66
{ARO} downstream ARO extension into azure-cli proper
komidore64 0cd1afe
{ARO} replace ARO extension module paths with azure-cli paths
komidore64 e5733c9
{ARO} include vendored SDKs
komidore64 9a14bf2
{ARO} fix validator tests
komidore64 ded56f1
{ARO} fix pylint sort/group import errors
komidore64 a0bcbb5
{ARO} fix flake8 complaints
komidore64 8b7006c
fix: routeTables is canonically plural
komidore64 9e11186
fix: roleDefinitions is canonically plural
komidore64 0e0d052
fix: account for short- and long-form role defintion IDs
komidore64 87148b9
fix: remove upstream dev mode switch
komidore64 8afa31c
fix: exclude vendored_sdks dir
komidore64 fc47eaf
chore: remove references to rp_mode_development
komidore64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
komidore64 marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,18 +10,17 @@ | |
| from os.path import exists | ||
| from collections import Counter | ||
|
|
||
| from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_subscription_id | ||
| from azure.cli.core.profiles import ResourceType | ||
| from azure.cli.command_modules.aro.aaz.latest.network.vnet.subnet import Show as subnet_show | ||
| from azure.cli.core.azclierror import ( | ||
| CLIInternalError, | ||
| InvalidArgumentValueError, | ||
| RequiredArgumentMissingError, | ||
| MutuallyExclusiveArgumentError | ||
| ) | ||
| from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_subscription_id | ||
| from azure.cli.core.profiles import ResourceType | ||
| from azure.core.exceptions import ResourceNotFoundError, HttpResponseError | ||
| from azure.mgmt.core.tools import is_valid_resource_id, parse_resource_id, resource_id | ||
| from azure.cli.command_modules.aro.aaz.latest.network.vnet.subnet import Show as subnet_show | ||
|
|
||
| from knack.log import get_logger | ||
|
|
||
| logger = get_logger(__name__) | ||
|
|
@@ -45,7 +44,8 @@ def _validate_client_id(namespace): | |
| if namespace.client_id is None: | ||
| return | ||
| if hasattr(namespace, 'enable_managed_identity') and namespace.enable_managed_identity is True: | ||
| raise MutuallyExclusiveArgumentError('Must not specify --client-id when --enable-managed-identity is True') # pylint: disable=line-too-long | ||
| raise MutuallyExclusiveArgumentError("Must not specify --client-id when " | ||
| "--enable-managed-identity/--enable-mi is True") | ||
| if namespace.platform_workload_identities is not None: | ||
| raise MutuallyExclusiveArgumentError('Must not specify --client-id when --assign-platform-workload-identity is used') # pylint: disable=line-too-long | ||
| try: | ||
|
|
@@ -65,7 +65,8 @@ def _validate_client_secret(namespace): | |
| if namespace.client_secret is None: | ||
| return | ||
| if hasattr(namespace, 'enable_managed_identity') and namespace.enable_managed_identity is True: | ||
| raise MutuallyExclusiveArgumentError('Must not specify --client-secret when --enable-managed-identity is True') # pylint: disable=line-too-long | ||
| raise MutuallyExclusiveArgumentError("Must not specify --client-secret when " | ||
| "--enable-managed-identity/--enable-mi is True") | ||
| if namespace.platform_workload_identities is not None: | ||
| raise MutuallyExclusiveArgumentError('Must not specify --client-secret when --assign-platform-workload-identity is used') # pylint: disable=line-too-long | ||
| if isCreate and (namespace.client_id is None or not str(namespace.client_id)): | ||
|
|
@@ -321,17 +322,27 @@ def validate_enable_managed_identity(namespace): | |
| if not namespace.enable_managed_identity: | ||
| return | ||
|
|
||
| if namespace.client_id is not None: | ||
| raise InvalidArgumentValueError('Must not specify --client-id when --enable-managed-identity is True') | ||
| if namespace.client_id: | ||
| raise InvalidArgumentValueError("Must not specify --client-id when " | ||
| "--enable-managed-identity/--enable-mi is True") | ||
|
|
||
| if namespace.client_secret: | ||
| raise InvalidArgumentValueError("Must not specify --client-secret when " | ||
| "--enable-managed-identity/--enable-mi is True") | ||
|
|
||
| if namespace.client_secret is not None: | ||
| raise InvalidArgumentValueError('Must not specify --client-secret when --enable-managed-identity is True') | ||
| if namespace.platform_workload_identities and not namespace.mi_user_assigned: | ||
| raise RequiredArgumentMissingError("Must specify --assign-cluster-identity/--mi-user-assigned " | ||
| "with --assign-platform-workload-identity/--assign-platform-wi") | ||
|
|
||
| if not namespace.platform_workload_identities: | ||
| raise RequiredArgumentMissingError('Enabling managed identity requires platform workload identities to be provided') # pylint: disable=line-too-long | ||
| if not namespace.platform_workload_identities and namespace.mi_user_assigned: | ||
| raise RequiredArgumentMissingError("Must specify --assign-platform-workload-identity/--assign-platform-wi " | ||
| "with --assign-cluster-identity/--mi-user-assigned") | ||
|
|
||
| if not namespace.mi_user_assigned: | ||
| raise RequiredArgumentMissingError('Enabling managed identity requires cluster identity to be provided') | ||
| if not namespace.platform_workload_identities and not namespace.mi_user_assigned and not namespace.version: | ||
| raise RequiredArgumentMissingError("--enable-managed-identity/--enable-mi without " | ||
| "--assign-cluster-identity/--mi-user-assigned and " | ||
| "--assign-platform-wi/--assign-platform-workload-identity " | ||
| "requires --version.") | ||
|
Comment on lines
+325
to
+345
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Relying on truthiness is Pythonic. |
||
|
|
||
|
|
||
| def validate_platform_workload_identities(isCreate): | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage Managed Identity | ||
| """ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| class Delete(AAZCommand): | ||
| """Delete the identity. | ||
| """ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,4 @@ | |
| # flake8: noqa | ||
|
|
||
| from .__cmd_group import * | ||
| from ._show import * | ||
| from ._show import * | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these new command_modules.aro.* imports required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking again, they're not new imports, rather they are just moved from the load_command_table to the top of the file, which I think is probably fine.