diff --git a/src/acrcssc/azext_acrcssc/_validators.py b/src/acrcssc/azext_acrcssc/_validators.py index a753134708e..244d23cd49d 100644 --- a/src/acrcssc/azext_acrcssc/_validators.py +++ b/src/acrcssc/azext_acrcssc/_validators.py @@ -17,7 +17,6 @@ CONTINUOUSPATCH_OCI_ARTIFACT_CONFIG, CONTINUOUSPATCH_CONFIG_SCHEMA_V1, CONTINUOUSPATCH_CONFIG_SCHEMA_SIZE_LIMIT, - CONTINUOUSPATCH_CONFIG_SUPPORTED_VERSIONS, CONTINUOUSPATCH_ALL_TASK_NAMES, ERROR_MESSAGE_INVALID_TIMESPAN_FORMAT, ERROR_MESSAGE_INVALID_TIMESPAN_VALUE, @@ -74,8 +73,6 @@ def _validate_continuouspatch_config(config): raise InvalidArgumentValueError(f"Configuration error: Repository '{repository['repository']}' with tag '{tag}' is not allowed. Tags ending with '*-patched' (floating tag) or '*-0' to '*-999' (incremental tag) are reserved for internal use.") if tag == "*" and len(repository.get("tags", [])) > 1: raise InvalidArgumentValueError("Configuration error: Tag '*' is not allowed with other tags in the same repository. Use '*' as the only tag in the repository to avoid overlaps.") - if config.get("version", "") not in CONTINUOUSPATCH_CONFIG_SUPPORTED_VERSIONS: - raise InvalidArgumentValueError(f"Configuration error: Version {config.get('version', '')} is not supported. Supported versions are {CONTINUOUSPATCH_CONFIG_SUPPORTED_VERSIONS}") # to save on API calls, we the list of tasks found in the registry diff --git a/src/acrcssc/azext_acrcssc/helper/_constants.py b/src/acrcssc/azext_acrcssc/helper/_constants.py index 692cefe7a8b..59a0b541bc9 100644 --- a/src/acrcssc/azext_acrcssc/helper/_constants.py +++ b/src/acrcssc/azext_acrcssc/helper/_constants.py @@ -94,16 +94,16 @@ class TaskRunStatus(Enum): }, } CONTINUOUSPATCH_CONFIG_SCHEMA_SIZE_LIMIT = 1024 * 1024 * 10 # 10MB, we don't want to allow huge files -CONTINUOUSPATCH_CONFIG_SUPPORTED_VERSIONS = ["v1"] CONTINUOUSPATCH_CONFIG_SCHEMA_V1 = { "type": "object", "properties": { "version": { "type": "string", + "pattern": "^(v1)$" }, "tag-convention": { "type": "string", - "pattern": "(?i)floating|incremental" + "pattern": "^(floating|incremental)$" }, "repositories": { "type": "array",