Skip to content

Commit

Permalink
Add flag to create command
Browse files Browse the repository at this point in the history
  • Loading branch information
tsatam committed Sep 21, 2023
1 parent abc31be commit 5e07ba0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/az/aro/azext_aro/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ def load_arguments(self, _):
c.argument('worker_subnet',
help='Name or ID of worker vnet subnet. If name is supplied, `--vnet` must be supplied.',
validator=validate_subnet('worker_subnet'))
c.argument('load_balancer_managed_outbound_ip_count',
type=int,
help='The desired number of IPv4 outbound IPs created and managed by Azure for the cluster public load balancer.', # pylint: disable=line-too-long
validator=validate_load_balancer_managed_outbound_ip_count,
options_list=['--load-balancer-managed-outbound-ip-count', '--lb-ip-count'])

with self.argument_context('aro update') as c:
c.argument('client_secret',
help='Client secret of cluster service principal.',
Expand All @@ -123,11 +129,7 @@ def load_arguments(self, _):
help='Refresh cluster application credentials.',
options_list=['--refresh-credentials'],
validator=validate_refresh_cluster_credentials)
c.argument('load_balancer_managed_outbound_ip_count',
type=int,
help='The desired number of IPv4 outbound IPs created and managed by Azure for the cluster public load balancer.', # pylint: disable=line-too-long
validator=validate_load_balancer_managed_outbound_ip_count,
options_list=['--load-balancer-managed-outbound-ip-count', '--lb-ip-count'])

with self.argument_context('aro get-admin-kubeconfig') as c:
c.argument('file',
help='Path to the file where kubeconfig should be saved. Default: kubeconfig in local directory',
Expand Down
8 changes: 8 additions & 0 deletions python/az/aro/azext_aro/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def aro_create(cmd, # pylint: disable=too-many-locals
worker_count=None,
apiserver_visibility=None,
ingress_visibility=None,
load_balancer_managed_outbound_ip_count=None,
tags=None,
version=None,
no_wait=False):
Expand Down Expand Up @@ -126,6 +127,12 @@ def aro_create(cmd, # pylint: disable=too-many-locals
if ingress_visibility is not None:
ingress_visibility = ingress_visibility.capitalize()

load_balancer_profile = None
if load_balancer_managed_outbound_ip_count is not None:
load_balancer_profile = openshiftcluster.LoadBalancerProfile()
load_balancer_profile.managed_outbound_ips = openshiftcluster.ManagedOutboundIPs()
load_balancer_profile.managed_outbound_ips.count = load_balancer_managed_outbound_ip_count # pylint: disable=line-too-long

oc = openshiftcluster.OpenShiftCluster(
location=location,
tags=tags,
Expand All @@ -145,6 +152,7 @@ def aro_create(cmd, # pylint: disable=too-many-locals
pod_cidr=pod_cidr or '10.128.0.0/14',
service_cidr=service_cidr or '172.30.0.0/16',
outbound_type=outbound_type or '',
load_balancer_profile=load_balancer_profile
),
master_profile=openshiftcluster.MasterProfile(
vm_size=master_vm_size or 'Standard_D8s_v3',
Expand Down

0 comments on commit 5e07ba0

Please sign in to comment.