Skip to content

Commit

Permalink
remove node resource group
Browse files Browse the repository at this point in the history
  • Loading branch information
FumingZhang committed May 26, 2022
1 parent c34a18d commit a5b97d6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
27 changes: 0 additions & 27 deletions src/aks-preview/azext_aks_preview/managed_cluster_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,6 @@ def __validate_pod_identity_with_kubenet(self, mc, enable_pod_identity, enable_p
"when using Kubenet network plugin"
)

def get_node_resource_group(self) -> Union[str, None]:
"""Obtain the value of node_resource_group.
:return: string or None
"""
# read the original value passed by the command
node_resource_group = self.raw_param.get("node_resource_group")
# try to read the property value corresponding to the parameter from the `mc` object
if self.mc and self.mc.node_resource_group is not None:
node_resource_group = self.mc.node_resource_group

# this parameter does not need dynamic completion
# this parameter does not need validation
return node_resource_group

def get_http_proxy_config(self) -> Union[Dict, ManagedClusterHTTPProxyConfig, None]:
"""Obtain the value of http_proxy_config.
Expand Down Expand Up @@ -1064,16 +1049,6 @@ def set_up_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
)
return mc

def set_up_node_resource_group(self, mc: ManagedCluster) -> ManagedCluster:
"""Set up node resource group for the ManagedCluster object.
:return: the ManagedCluster object
"""
self._ensure_mc(mc)

mc.node_resource_group = self.context.get_node_resource_group()
return mc

def set_up_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:
"""Set up http proxy config for the ManagedCluster object.
Expand Down Expand Up @@ -1201,8 +1176,6 @@ def construct_mc_profile_preview(self, bypass_restore_defaults: bool = False) ->
# construct the default AgentPool profile
mc = self.construct_mc_profile_default(bypass_restore_defaults=True)

# set up node resource group
mc = self.set_up_node_resource_group(mc)
# set up http proxy config
mc = self.set_up_http_proxy_config(mc)
# set up pod security policy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,6 @@ def test_validate_pod_identity_with_kubenet(self):
with self.assertRaises(RequiredArgumentMissingError):
ctx_1._AKSPreviewManagedClusterContext__validate_pod_identity_with_kubenet(mc_1, True, False)

def test_get_node_resource_group(self):
# default
ctx_1 = AKSPreviewManagedClusterContext(
self.cmd,
AKSManagedClusterParamDict({"node_resource_group": None}),
self.models,
decorator_mode=DecoratorMode.CREATE,
)
self.assertEqual(ctx_1.get_node_resource_group(), None)
mc = self.models.ManagedCluster(
location="test_location",
node_resource_group="test_node_resource_group",
)
ctx_1.attach_mc(mc)
self.assertEqual(ctx_1.get_node_resource_group(), "test_node_resource_group")

def test_get_http_proxy_config(self):
# default
ctx_1 = AKSPreviewManagedClusterContext(
Expand Down Expand Up @@ -1562,25 +1546,6 @@ def test_set_up_network_profile(self):
ground_truth_mc_1 = self.models.ManagedCluster(location="test_location", network_profile=network_profile_1)
self.assertEqual(dec_mc_1, ground_truth_mc_1)

def test_set_up_node_resource_group(self):
dec_1 = AKSPreviewManagedClusterCreateDecorator(
self.cmd,
self.client,
{"node_resource_group": "test_node_resource_group"},
CUSTOM_MGMT_AKS_PREVIEW,
)
mc_1 = self.models.ManagedCluster(location="test_location")
dec_1.context.attach_mc(mc_1)
# fail on passing the wrong mc object
with self.assertRaises(CLIInternalError):
dec_1.set_up_node_resource_group(None)
dec_mc_1 = dec_1.set_up_node_resource_group(mc_1)
ground_truth_mc_1 = self.models.ManagedCluster(
location="test_location",
node_resource_group="test_node_resource_group",
)
self.assertEqual(dec_mc_1, ground_truth_mc_1)

def test_set_up_http_proxy_config(self):
dec_1 = AKSPreviewManagedClusterCreateDecorator(
self.cmd,
Expand Down

0 comments on commit a5b97d6

Please sign in to comment.