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 implementation of Azure Dedicated Host #5433

Merged
merged 3 commits into from
Dec 13, 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
1 change: 1 addition & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pending
+++++++

* GA file, blob csi driver and snapshot controller.
* GA Azure Dedicated Host.

0.5.119
+++++++
Expand Down
4 changes: 2 additions & 2 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def load_arguments(self, _):
c.argument('enable_node_restriction', action='store_true', is_preview=True, help="enable node restriction for cluster")
c.argument('enable_cilium_dataplane', action='store_true', is_preview=True)
# nodepool
c.argument('host_group_id', validator=validate_host_group_id, is_preview=True)
c.argument('host_group_id', validator=validate_host_group_id)
c.argument('crg_id', validator=validate_crg_id, is_preview=True)
# no validation for aks create because it already only supports Linux.
c.argument('message_of_the_day')
Expand Down Expand Up @@ -515,7 +515,7 @@ def load_arguments(self, _):
c.argument('linux_os_config')
c.argument('aks_custom_headers')
# extensions
c.argument('host_group_id', validator=validate_host_group_id, is_preview=True)
c.argument('host_group_id', validator=validate_host_group_id)
c.argument('crg_id', validator=validate_crg_id, is_preview=True)
c.argument('message_of_the_day', validator=validate_message_of_the_day)
c.argument('workload_runtime', arg_type=get_enum_type(workload_runtimes), default=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER)
Expand Down
19 changes: 0 additions & 19 deletions src/aks-preview/azext_aks_preview/agentpool_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,6 @@ def get_zones(self) -> Union[List[str], None]:
# read the original value passed by the command
return self.raw_param.get("node_zones")

def get_host_group_id(self) -> Union[str, None]:
"""Obtain the value of host_group_id.

:return: string or None
"""
# read the original value passed by the command
host_group_id = self.raw_param.get("host_group_id")
# try to read the property value corresponding to the parameter from the `agentpool` object
if (
self.agentpool and
self.agentpool.host_group_id is not None
):
host_group_id = self.agentpool.host_group_id

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

def get_crg_id(self) -> Union[str, None]:
"""Obtain the value of crg_id.

Expand Down Expand Up @@ -357,7 +339,6 @@ def set_up_preview_vm_properties(self, agentpool: AgentPool) -> AgentPool:
"""
self._ensure_agentpool(agentpool)

agentpool.host_group_id = self.context.get_host_group_id()
agentpool.capacity_reservation_group_id = self.context.get_crg_id()
return agentpool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ def common_get_zones(self):
)
self.assertEqual(ctx_2.get_zones(), "test_zones")

def common_get_host_group_id(self):
# default
ctx_1 = AKSPreviewAgentPoolContext(
self.cmd,
AKSAgentPoolParamDict({"host_group_id": None}),
self.models,
DecoratorMode.CREATE,
self.agentpool_decorator_mode,
)
self.assertEqual(ctx_1.get_host_group_id(), None)
agentpool_1 = self.create_initialized_agentpool_instance(host_group_id="test_host_group_id")
ctx_1.attach_agentpool(agentpool_1)
self.assertEqual(ctx_1.get_host_group_id(), "test_host_group_id")

def common_get_crg_id(self):
# default
ctx_1 = AKSPreviewAgentPoolContext(
Expand Down Expand Up @@ -271,9 +257,6 @@ def setUp(self):
def test_get_zones(self):
self.common_get_zones()

def test_get_host_group_id(self):
self.common_get_host_group_id()

def test_get_crg_id(self):
self.common_get_crg_id()

Expand Down Expand Up @@ -306,9 +289,6 @@ def setUp(self):
def test_get_zones(self):
self.common_get_zones()

def test_get_host_group_id(self):
self.common_get_host_group_id()

def test_get_crg_id(self):
self.common_get_crg_id()

Expand Down Expand Up @@ -373,7 +353,7 @@ def common_set_up_preview_vm_properties(self):
dec_1 = AKSPreviewAgentPoolAddDecorator(
self.cmd,
self.client,
{"host_group_id": "test_host_group_id", "crg_id": "test_crg_id"},
{"crg_id": "test_crg_id"},
self.resource_type,
self.agentpool_decorator_mode,
)
Expand All @@ -385,7 +365,7 @@ def common_set_up_preview_vm_properties(self):
dec_agentpool_1 = dec_1.set_up_preview_vm_properties(agentpool_1)
dec_agentpool_1 = self._restore_defaults_in_agentpool(dec_agentpool_1)
ground_truth_agentpool_1 = self.create_initialized_agentpool_instance(
host_group_id="test_host_group_id", capacity_reservation_group_id="test_crg_id"
capacity_reservation_group_id="test_crg_id"
)
self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1)

Expand Down