Skip to content

Commit

Permalink
Merge branch 'aca-0.3.12' into eventstream
Browse files Browse the repository at this point in the history
  • Loading branch information
StrawnSC authored Oct 4, 2022
2 parents 4abb34f + ae8d23b commit ff63c2c
Show file tree
Hide file tree
Showing 5 changed files with 628 additions and 20,490 deletions.
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Release History
* 'az containerapp logs show': add new parameter "--kind" to allow showing system logs
* Show system environment logs with new command 'az containerapp env logs show'
* Add tcp support for ingress transport and scale rules
* 'az containerapp create/update': validate revision suffixes

0.3.11
++++++
Expand Down
9 changes: 9 additions & 0 deletions src/containerapp/azext_containerapp/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
MutuallyExclusiveArgumentError)
from msrestazure.tools import is_valid_resource_id
from knack.log import get_logger
import re

from ._clients import ContainerAppClient
from ._ssh_utils import ping_container_app
Expand Down Expand Up @@ -38,6 +39,14 @@ def _is_number(s):
return False


def validate_revision_suffix(value):
if value is not None:
matched = re.match(r"^[a-z](?!.*-{2})([-a-z0-9]*[a-z0-9])?$", value)
if not matched:
raise ValidationError(f"Invalid Container App revision name '{value}'. A revision name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character and cannot have '--'.")



def validate_memory(namespace):
if namespace.memory is not None:
valid = False
Expand Down
4 changes: 3 additions & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
validate_hostname, patch_new_custom_domain, get_custom_domains, _validate_revision_name, set_managed_identity,
create_acrpull_role_assignment, is_registry_msi_system, clean_null_values, _populate_secret_values,
validate_environment_location, safe_set, parse_metadata_flags, parse_auth_flags)
from ._validators import validate_create
from ._validators import validate_create, validate_revision_suffix
from ._ssh_utils import (SSH_DEFAULT_ENCODING, WebSocketConnection, read_ssh, get_stdin_writer, SSH_CTRL_C_MSG,
SSH_BACKUP_ENCODING)
from ._constants import (MAXIMUM_SECRET_LENGTH, MICROSOFT_SECRET_SETTING_NAME, FACEBOOK_SECRET_SETTING_NAME, GITHUB_SECRET_SETTING_NAME,
Expand Down Expand Up @@ -346,6 +346,7 @@ def create_containerapp(cmd,
register_provider_if_needed(cmd, CONTAINER_APPS_RP)
validate_container_app_name(name)
validate_create(registry_identity, registry_pass, registry_user, registry_server, no_wait)
validate_revision_suffix(revision_suffix)

if registry_identity and not is_registry_msi_system(registry_identity):
logger.info("Creating an acrpull role assignment for the registry identity")
Expand Down Expand Up @@ -602,6 +603,7 @@ def update_containerapp_logic(cmd,
registry_user=None,
registry_pass=None):
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
validate_revision_suffix(revision_suffix)

# Validate that max_replicas is set to 0-30
if max_replicas is not None:
Expand Down

Large diffs are not rendered by default.

11,459 changes: 364 additions & 11,095 deletions src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_e2e.yaml

Large diffs are not rendered by default.

0 comments on commit ff63c2c

Please sign in to comment.