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

Adding endpoint type option to the extension #1241

Merged
merged 17 commits into from
Feb 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/dev-spaces/azext_dev_spaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def load_arguments(self, _):
c.argument('cluster_name', options_list=['--name', '-n'])
c.argument('update', options_list=['--update'], action='store_true')
c.argument('space_name', options_list=['--space', '-s'])
c.argument('endpoint_type', options_list=['--endpoint', '-e'])
c.argument('do_not_prompt', options_list=['--yes', '-y'],
action='store_true', help='Do not prompt for confirmation. Requires --space.')

Expand Down
9 changes: 8 additions & 1 deletion src/dev-spaces/azext_dev_spaces/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# pylint:disable=no-member,too-many-lines,too-many-locals,too-many-statements


def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_name=None, do_not_prompt=False):
def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_name=None, endpoint_type=None, do_not_prompt=False):
rakeshvanga marked this conversation as resolved.
Show resolved Hide resolved
"""
Use Azure Dev Spaces with a managed Kubernetes cluster.

Expand All @@ -31,6 +31,9 @@ def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_na
:type update: bool
:param space_name: Name of the new or existing dev space to select. Defaults to an interactive selection experience.
:type space_name: String
:param endpoint_type: The endpoint type to be used for a Azure Dev Spaces controller. \
See https://aka.ms/azds-networking for more information.
:type endpoint_type: String
:param do_not_prompt: Do not prompt for confirmation. Requires --space.
:type do_not_prompt: bool
"""
Expand All @@ -44,6 +47,10 @@ def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_na
use_command_arguments.append('--space')
use_command_arguments.append(space_name)

if endpoint_type is not None:
use_command_arguments.append('--endpoint')
use_command_arguments.append(endpoint_type)

if do_not_prompt:
use_command_arguments.append('-y')
subprocess.call(
Expand Down