Skip to content
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

[AKS] Remove warning message when using "BYO vnet + system MSI" #23080

Merged
merged 1 commit into from
Jul 12, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -4124,21 +4124,6 @@ def process_add_role_assignment_for_vnet_subnet(self, mc: ManagedCluster) -> Non
service_principal_profile = mc.service_principal_profile
assign_identity = self.context.get_assign_identity()
if service_principal_profile is None and not assign_identity:
msg = (
"It is highly recommended to use USER assigned identity "
"(option --assign-identity) when you want to bring your own"
"subnet, which will have no latency for the role assignment to "
"take effect. When using SYSTEM assigned identity, "
"azure-cli will grant Network Contributor role to the "
"system assigned identity after the cluster is created, and "
"the role assignment will take some time to take effect, see "
"https://docs.microsoft.com/azure/aks/use-managed-identity, "
"proceed to create cluster with system assigned identity?"
)
if not self.context.get_yes() and not prompt_y_n(
msg, default="n"
):
raise DecoratorEarlyExitException()
need_post_creation_vnet_permission_granting = True
else:
scope = vnet_subnet_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4342,16 +4342,11 @@ def test_process_add_role_assignment_for_vnet_subnet(self):
with patch(
"azure.cli.command_modules.acs.managed_cluster_decorator.subnet_role_assignment_exists",
return_value=False,
), patch(
"azure.cli.command_modules.acs.managed_cluster_decorator.prompt_y_n",
return_value=False,
):
# fail on user does not confirm
with self.assertRaises(DecoratorEarlyExitException):
dec_3.process_add_role_assignment_for_vnet_subnet(mc_3)
dec_3.process_add_role_assignment_for_vnet_subnet(mc_3)
self.assertEqual(
dec_3.context.get_intermediate("need_post_creation_vnet_permission_granting"),
None,
True,
)

# custom value
Expand Down