Skip to content

Commit

Permalink
Add missing parameter mapping
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Verst <github@bernd.dev>
  • Loading branch information
berndverst committed Jan 30, 2024
1 parent 6b1e177 commit 360c89c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
16 changes: 14 additions & 2 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,13 @@ def create_dapr_component_resiliency(cmd, name, resource_group_name, dapr_compon
in_http_retry_delay_in_milliseconds=None,
out_http_retry_delay_in_milliseconds=None,
in_http_retry_interval_in_milliseconds=None,
out_http_retry_interval_in_milliseconds=None):
out_http_retry_interval_in_milliseconds=None,
in_circuit_breaker_consecutive_errors=None,
out_circuit_breaker_consecutive_errors=None,
in_circuit_breaker_interval=None,
out_circuit_breaker_interval=None,
in_circuit_breaker_timeout=None,
out_circuit_breaker_timeout=None):
raw_parameters = locals()
component_resiliency_create_decorator = DaprComponentResiliencyPreviewCreateDecorator(
cmd=cmd,
Expand All @@ -325,7 +331,13 @@ def update_dapr_component_resiliency(cmd, name, resource_group_name, dapr_compon
in_http_retry_delay_in_milliseconds=None,
out_http_retry_delay_in_milliseconds=None,
in_http_retry_interval_in_milliseconds=None,
out_http_retry_interval_in_milliseconds=None):
out_http_retry_interval_in_milliseconds=None,
in_circuit_breaker_consecutive_errors=None,
out_circuit_breaker_consecutive_errors=None,
in_circuit_breaker_interval=None,
out_circuit_breaker_interval=None,
in_circuit_breaker_timeout=None,
out_circuit_breaker_timeout=None):

raw_parameters = locals()
component_resiliency_update_decorator = DaprComponentResiliencyPreviewUpdateDecorator(
Expand Down
2 changes: 1 addition & 1 deletion src/containerapp/azext_containerapp/tests/latest/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from azure.cli.testsdk import (ScenarioTest)

TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
STAGE_LOCATION = os.getenv("CLIStageLocation") if os.getenv("CLIStageLocation") else "northcentralusstage"
STAGE_LOCATION = "northcentralusstage"
TEST_LOCATION = os.getenv("CLITestLocation") if os.getenv("CLITestLocation") else STAGE_LOCATION


Expand Down
16 changes: 11 additions & 5 deletions src/containerapp/azext_containerapp/tests/latest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

import sys
import time
import requests
from azure.cli.command_modules.containerapp._utils import format_location
Expand All @@ -27,7 +27,7 @@ def prepare_containerapp_env_for_app_e2e_tests(test_cls, location=TEST_LOCATION)
rg_location = location
if format_location(rg_location) == format_location(STAGE_LOCATION):
rg_location = "eastus"
test_cls.cmd(f'group create -n {rg_name} -l {location}')
test_cls.cmd(f'group create -n {rg_name} -l {rg_location}')
test_cls.cmd(f'containerapp env create -g {rg_name} -n {env_name} --logs-destination none')
managed_env = test_cls.cmd('containerapp env show -g {} -n {}'.format(rg_name, env_name)).get_output_in_json()

Expand All @@ -37,15 +37,21 @@ def prepare_containerapp_env_for_app_e2e_tests(test_cls, location=TEST_LOCATION)
return managed_env["id"]


def create_containerapp_env(test_cls, env_name, resource_group, location=TEST_LOCATION):
def create_containerapp_env(test_cls, env_name, resource_group, location=None, subnetId=None):
logs_workspace_name = test_cls.create_random_name(prefix='containerapp-env', length=24)
logs_workspace_location = location
if format_location(logs_workspace_location) == format_location(STAGE_LOCATION):
if logs_workspace_location is None or format_location(logs_workspace_location) == format_location(STAGE_LOCATION):
logs_workspace_location = "eastus"
logs_workspace_id = test_cls.cmd('monitor log-analytics workspace create -g {} -n {} -l {}'.format(resource_group, logs_workspace_name, logs_workspace_location)).get_output_in_json()["customerId"]
logs_workspace_key = test_cls.cmd('monitor log-analytics workspace get-shared-keys -g {} -n {}'.format(resource_group, logs_workspace_name)).get_output_in_json()["primarySharedKey"]

test_cls.cmd(f'containerapp env create -g {resource_group} -n {env_name} --logs-workspace-id {logs_workspace_id} --logs-workspace-key {logs_workspace_key} -l {location}')
env_command = f'containerapp env create -g {resource_group} -n {env_name} --logs-workspace-id {logs_workspace_id} --logs-workspace-key {logs_workspace_key}'
if location:
env_command = f'{env_command} -l {location}'

if subnetId:
env_command = f'{env_command} --infrastructure-subnet-resource-id {subnetId}'
test_cls.cmd(env_command)

containerapp_env = test_cls.cmd('containerapp env show -g {} -n {}'.format(resource_group, env_name)).get_output_in_json()

Expand Down

0 comments on commit 360c89c

Please sign in to comment.