Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ upcoming
* 'az containerapp list-usages': list usages in subscription
* 'az containerapp env list-usages': list usages in environment
* 'az containerapp update': --yaml support property additionalPortMappings for api-version 2023-05-02-preview
* 'az containerapp create/update': raise ValidationError when value in --yaml is None

0.3.37
++++++
Expand Down
2 changes: 2 additions & 0 deletions src/containerapp/azext_containerapp/_decorator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def create_deserializer(models):


def process_loaded_yaml(yaml_containerapp):
if type(yaml_containerapp) != dict: # pylint: disable=unidiomatic-typecheck
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid containerapps YAML spec.')
if not yaml_containerapp.get('properties'):
yaml_containerapp['properties'] = {}

Expand Down
10 changes: 2 additions & 8 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@

# These properties should be under the "properties" attribute. Move the properties under "properties" attribute
def process_loaded_yaml(yaml_containerapp):
if type(yaml_containerapp) != dict: # pylint: disable=unidiomatic-typecheck
Comment thread
Greedygre marked this conversation as resolved.
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid containerapps YAML spec.')
if not yaml_containerapp.get('properties'):
yaml_containerapp['properties'] = {}

Expand Down Expand Up @@ -249,8 +251,6 @@ def delete_mariadb_service(cmd, service_name, resource_group_name, no_wait=False

def update_containerapp_yaml(cmd, name, resource_group_name, file_name, from_revision=None, no_wait=False):
yaml_containerapp = process_loaded_yaml(load_yaml_file(file_name))
if type(yaml_containerapp) != dict: # pylint: disable=unidiomatic-typecheck
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid containerapps YAML spec.')

if not yaml_containerapp.get('name'):
yaml_containerapp['name'] = name
Expand Down Expand Up @@ -339,8 +339,6 @@ def update_containerapp_yaml(cmd, name, resource_group_name, file_name, from_rev

def create_containerapp_yaml(cmd, name, resource_group_name, file_name, no_wait=False):
yaml_containerapp = process_loaded_yaml(load_yaml_file(file_name))
if type(yaml_containerapp) != dict: # pylint: disable=unidiomatic-typecheck
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid containerapps YAML spec.')

if not yaml_containerapp.get('name'):
yaml_containerapp['name'] = name
Expand Down Expand Up @@ -1286,8 +1284,6 @@ def update_containerappsjob_logic(cmd,

def create_containerappsjob_yaml(cmd, name, resource_group_name, file_name, no_wait=False):
yaml_containerappsjob = process_loaded_yaml(load_yaml_file(file_name))
if type(yaml_containerappsjob) != dict: # pylint: disable=unidiomatic-typecheck
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid YAML spec.')

if not yaml_containerappsjob.get('name'):
yaml_containerappsjob['name'] = name
Expand Down Expand Up @@ -1374,8 +1370,6 @@ def create_containerappsjob_yaml(cmd, name, resource_group_name, file_name, no_w

def update_containerappjob_yaml(cmd, name, resource_group_name, file_name, from_revision=None, no_wait=False):
yaml_containerappsjob = process_loaded_yaml(load_yaml_file(file_name))
if type(yaml_containerappsjob) != dict: # pylint: disable=unidiomatic-typecheck
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid YAML spec.')

if not yaml_containerappsjob.get('name'):
yaml_containerappsjob['name'] = name
Expand Down
Loading