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 6 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
3 changes: 3 additions & 0 deletions src/dev-spaces/azext_dev_spaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from azure.cli.core import AzCommandsLoader
from azure.cli.core.commands import CliCommandType
from azure.cli.core.commands.parameters import (get_enum_type)
import azext_dev_spaces._help # pylint: disable=unused-import
import azext_dev_spaces.custom # pylint: disable=unused-import

Expand All @@ -31,6 +32,8 @@ 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', get_enum_type(['Public', 'Private', 'None'], default='Public'),
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
8 changes: 6 additions & 2 deletions src/dev-spaces/azext_dev_spaces/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# 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='Public', do_not_prompt=False):
"""
Use Azure Dev Spaces with a managed Kubernetes cluster.

Expand All @@ -31,14 +32,17 @@ 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
"""

azds_cli = _install_dev_spaces_cli(update, do_not_prompt)

use_command_arguments = [azds_cli, 'use', '--name', cluster_name,
'--resource-group', resource_group_name]
'--resource-group', resource_group_name, '--endpoint', endpoint_type]

if space_name is not None:
use_command_arguments.append('--space')
Expand Down
2 changes: 1 addition & 1 deletion src/dev-spaces/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from setuptools import setup, find_packages

VERSION = "1.0.4"
VERSION = "1.0.5"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down
45 changes: 45 additions & 0 deletions src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -984,11 +984,56 @@
}
],
"dev-spaces": [
{
"downloadUrl": "https://azuredevspacestools.blob.core.windows.net/azdssetup/LKS/dev_spaces-1.0.5-py2.py3-none-any.whl",
"filename": "dev_spaces-1.0.5-py2.py3-none-any.whl",
"metadata": {
"azext.minCliCoreVersion": "2.0.82",
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: MIT License"
],
"extensions": {
"python.details": {
"contacts": [
{
"email": "azds-azcli@microsoft.com",
"name": "Microsoft Corporation",
"role": "author"
}
],
"document_names": {
"description": "DESCRIPTION.rst"
},
"project_urls": {
"Home": "https://github.com/Azure/azure-cli-extensions"
}
}
},
"generator": "bdist_wheel (0.30.0)",
"license": "MIT",
"metadata_version": "2.0",
"name": "dev-spaces",
"summary": "Dev Spaces provides a rapid, iterative Kubernetes development experience for teams.",
"version": "1.0.5"
},
"sha256Digest": "C3578A28CE2D2D07235A6417EAA57D0CE9656EF8FAB79621F2E531DBD53BEF85"
},
{
"downloadUrl": "https://azuredevspacestools.blob.core.windows.net/azdssetup/LKS/dev_spaces-1.0.4-py2.py3-none-any.whl",
"filename": "dev_spaces-1.0.4-py2.py3-none-any.whl",
"metadata": {
"azext.minCliCoreVersion": "2.0.63",
"azext.maxCliCoreVersion": "2.0.81",
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down