Skip to content

Commit df09593

Browse files
Refactor NAT gateway outbound IP assignment
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 0b952e5 commit df09593

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/azure-cli/azure/cli/command_modules/acs/_natgateway.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ def configure_nat_gateway_profile(
100100

101101
if outbound_ip_ids is not None:
102102
ManagedClusterNATGatewayProfileOutboundIPs = models.ManagedClusterNATGatewayProfileOutboundIPs
103+
if ManagedClusterNATGatewayProfileOutboundIPs is None:
104+
raise ValueError("The selected AKS API profile/SDK does not support setting NAT gateway outbound IPs.")
103105
ip_id_list = [x.strip() for x in outbound_ip_ids.split(',') if x.strip()]
104-
profile.outbound_i_ps = ManagedClusterNATGatewayProfileOutboundIPs(
105-
public_i_ps=ip_id_list
106-
)
106+
profile.outbound_i_ps = ManagedClusterNATGatewayProfileOutboundIPs(public_i_ps=ip_id_list)
107107

108108
if outbound_ip_prefix_ids is not None:
109109
ManagedClusterNATGatewayProfileOutboundIpPrefixes = models.ManagedClusterNATGatewayProfileOutboundIpPrefixes

0 commit comments

Comments
 (0)