Skip to content

Commit 6aff0ee

Browse files
aks-preview: Fix managedNATGatewayV2 outbound type being overwritten to loadBalancer
The dynamic completion logic in _get_outbound_type() did not include managedNATGatewayV2 in its list of known outbound types. When a user specified --outbound-type managedNATGatewayV2, the CLI treated it as an unrecognized value and silently overwrote it to loadBalancer before sending the request to the RP. Fixed in 3 places: - Dynamic completion list: preserve managedNATGatewayV2 instead of overwriting to loadBalancer - Basic LB SKU validation: reject managedNATGatewayV2 with basic SKU - Multi-zone warning: show zone-redundancy warning for V2 on update
1 parent efcf6e1 commit 6aff0ee

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ def _get_outbound_type(
561561
not read_from_mc and
562562
outbound_type not in [
563563
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
564+
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY_V2,
564565
CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY,
565566
CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING,
566567
CONST_OUTBOUND_TYPE_NONE,
@@ -580,6 +581,7 @@ def _get_outbound_type(
580581
if outbound_type in [
581582
CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING,
582583
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
584+
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY_V2,
583585
CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY,
584586
]:
585587
if safe_lower(self._get_load_balancer_sku(enable_validation=False)) == CONST_LOAD_BALANCER_SKU_BASIC:
@@ -622,7 +624,10 @@ def _get_outbound_type(
622624
a standard load balancer with IP addresses"
623625
)
624626
if self.decorator_mode == DecoratorMode.UPDATE:
625-
if outbound_type == CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY:
627+
if outbound_type in [
628+
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
629+
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY_V2,
630+
]:
626631
if self.mc.agent_pool_profiles is not None and len(self.mc.agent_pool_profiles) > 1:
627632
multizoned = False
628633
for ap in self.mc.agent_pool_profiles:

0 commit comments

Comments
 (0)