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

{appservice-kube} Ensure compatibility with upcoming CLI version #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions src/appservice-kube/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.1.3
++++++
* Ensure compatibility of 'az webapp create' with CLI version 2.33.0

0.1.2
++++++
* Allow passing custom locations by name if in the same resource group as the app/plan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.26.0"
"azext.minCliCoreVersion": "2.33.0"
}
10 changes: 5 additions & 5 deletions src/appservice-kube/azext_appservice_kube/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
from msrestazure.tools import is_valid_resource_id, parse_resource_id

from ._constants import (FUNCTIONS_VERSION_TO_DEFAULT_RUNTIME_VERSION, FUNCTIONS_VERSION_TO_DEFAULT_NODE_VERSION,
FUNCTIONS_VERSION_TO_SUPPORTED_RUNTIME_VERSIONS, NODE_EXACT_VERSION_DEFAULT,
FUNCTIONS_VERSION_TO_SUPPORTED_RUNTIME_VERSIONS,
DOTNET_RUNTIME_VERSION_TO_DOTNET_LINUX_FX_VERSION, KUBE_DEFAULT_SKU,
KUBE_ASP_KIND, KUBE_APP_KIND, KUBE_FUNCTION_APP_KIND, KUBE_FUNCTION_CONTAINER_APP_KIND,
KUBE_CONTAINER_APP_KIND, LINUX_RUNTIMES, WINDOWS_RUNTIMES)
Expand Down Expand Up @@ -751,7 +751,6 @@ def create_webapp(cmd, resource_group_name, name, plan=None, runtime=None, custo
_validate_asp_sku(app_service_environment=None, custom_location=custom_location, sku=plan_info.sku.name)

is_linux = plan_info.reserved
node_default_version = NODE_EXACT_VERSION_DEFAULT
location = plan_info.location

if isinstance(plan_info.sku, SkuDescription) and plan_info.sku.name.upper() not in ['F1', 'FREE', 'SHARED', 'D1',
Expand Down Expand Up @@ -795,7 +794,7 @@ def create_webapp(cmd, resource_group_name, name, plan=None, runtime=None, custo

site_config.app_settings.append(NameValuePair(name='DOCKER_REGISTRY_SERVER_PASSWORD',
value=docker_registry_server_password))
helper = _StackRuntimeHelper(cmd, client, linux=(is_linux or is_kube))
helper = _StackRuntimeHelper(cmd, client, linux=(is_linux or is_kube), windows=not (is_linux or is_kube))
if runtime:
runtime = helper.remove_delimiters(runtime)

Expand All @@ -814,7 +813,7 @@ def create_webapp(cmd, resource_group_name, name, plan=None, runtime=None, custo
if not match:
raise CLIError("Linux Runtime '{}' is not supported."
"Please invoke 'list-runtimes' to cross check".format(runtime))
match['setter'](cmd=cmd, stack=match, site_config=site_config)
match.get_site_config_setter(match, linux=is_linux)(cmd=cmd, stack=match, site_config=site_config)
elif deployment_container_image_name:
site_config.linux_fx_version = _format_fx_version(deployment_container_image_name)
if name_validation.name_available:
Expand Down Expand Up @@ -845,13 +844,14 @@ def create_webapp(cmd, resource_group_name, name, plan=None, runtime=None, custo
if not match:
raise CLIError("Windows runtime '{}' is not supported. "
"Please invoke 'az webapp list-runtimes' to cross check".format(runtime))
match['setter'](cmd=cmd, stack=match, site_config=site_config)
match.get_site_config_setter(match, linux=is_linux)(cmd=cmd, stack=match, site_config=site_config)

# portal uses the current_stack propety in metadata to display stack for windows apps
current_stack = get_current_stack_from_runtime(runtime)

else: # windows webapp without runtime specified
if name_validation.name_available: # If creating new webapp
node_default_version = helper.get_default_version("node", is_linux, get_windows_config_version=True)
site_config.app_settings.append(NameValuePair(name="WEBSITE_NODE_DEFAULT_VERSION",
value=node_default_version))

Expand Down
2 changes: 1 addition & 1 deletion src/appservice-kube/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# TODO: Confirm this is the right version number you want and it matches your
# HISTORY.rst entry.
VERSION = '0.1.2'
VERSION = '0.1.3'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down