Skip to content

Commit

Permalink
Revert "disallow refresh_cluster_credentials with platform_workload_i…
Browse files Browse the repository at this point in the history
…dentities"

This reverts commit 329322a0fecb15127b316c726f305d374092b113.
  • Loading branch information
slawande2 committed Oct 7, 2024
1 parent d17feb4 commit 6593f24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/az/aro/azext_aro/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def validate_refresh_cluster_credentials(namespace):
return
if namespace.client_secret is not None or namespace.client_id is not None:
raise RequiredArgumentMissingError('--client-id and --client-secret must be not set with --refresh-credentials.') # pylint: disable=line-too-long
if namespace.platform_workload_identities is not None:
raise MutuallyExclusiveArgumentError('--platform-workload-identities must be not set with --refresh-credentials.') # pylint: disable=line-too-long
if namespace.upgradeable_to is not None:
raise MutuallyExclusiveArgumentError('Must not specify --refresh-credentials when --upgradeable-to is used.') # pylint: disable=line-too-long


def validate_version_format(namespace):
Expand Down
9 changes: 5 additions & 4 deletions python/az/aro/azext_aro/tests/latest/unit/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,14 +817,15 @@ def test_validate_worker_vm_disk_size_gb(test_description, namespace, expected_e
),
(
"should not raise any Exception because namespace.client_secret is None and namespace.client_id is None",
Mock(platform_workload_identities=None, client_secret=None, client_id=None),
Mock(upgradeable_to=None, client_secret=None, client_id=None),
None
),
(
"should raise MutuallyExclusiveArgumentError Exception because namespace.platform_workload_identities is present",
Mock(platform_workload_identities=[Mock(resource_id='Foo')], client_id=None, client_secret=None),
"should raise MutuallyExclusiveArgumentError exception because namespace.upgradeable_to is not None",
Mock(upgradeable_to="4.14.2", client_id=None, client_secret=None),
MutuallyExclusiveArgumentError
)
),

]


Expand Down

0 comments on commit 6593f24

Please sign in to comment.