fix(resources): remove overlay from SandboxStrategy enum - not in spec
CI / lint (pull_request) Successful in 27s
CI / typecheck (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 38s
CI / security (pull_request) Successful in 58s
CI / build (pull_request) Successful in 29s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 6m46s
CI / e2e_tests (pull_request) Successful in 18m2s
CI / integration_tests (pull_request) Successful in 22m24s
CI / docker (pull_request) Successful in 1m20s
CI / coverage (pull_request) Successful in 11m11s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 57m8s
CI / lint (pull_request) Successful in 27s
CI / typecheck (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 38s
CI / security (pull_request) Successful in 58s
CI / build (pull_request) Successful in 29s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 6m46s
CI / e2e_tests (pull_request) Successful in 18m2s
CI / integration_tests (pull_request) Successful in 22m24s
CI / docker (pull_request) Successful in 1m20s
CI / coverage (pull_request) Successful in 11m11s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 57m8s
Add 'overlay' to _VALID_STRATEGIES frozenset in ResourceTypeConfigSchema validator so that resource type YAML configs specifying sandbox_strategy: overlay are accepted without raising ValueError. The overlay strategy is defined in the specification for fs-mount resources using OverlayFS. The domain model SandboxStrategy enum correctly includes OVERLAY = 'overlay', but the YAML schema validator in src/cleveragents/resource/schema.py was missing it from _VALID_STRATEGIES, causing a validation error on valid configurations. Changes: - Add 'overlay' to _VALID_STRATEGIES in src/cleveragents/resource/schema.py - Add BDD scenario: 'Schema accepts overlay sandbox strategy' - Add step definitions for the new scenario ISSUES CLOSED: #2827
This commit is contained in:
@@ -891,3 +891,8 @@ Feature: Consolidated Resource
|
||||
When I load the resource type via from_yaml
|
||||
Then the loaded schema should have parent type "custom-parent"
|
||||
|
||||
|
||||
Scenario: Schema accepts overlay sandbox strategy
|
||||
Given a resource type YAML with sandbox_strategy "overlay"
|
||||
When I load the resource type via from_yaml
|
||||
Then the loaded schema sandbox_strategy should be "overlay"
|
||||
|
||||
@@ -598,3 +598,19 @@ def step_try_load_none_file_path(context):
|
||||
@then('the loaded schema should have parent type "{parent}"')
|
||||
def step_loaded_schema_parent_type(context, parent):
|
||||
assert parent in context.rt_schema.parent_types
|
||||
|
||||
|
||||
@given('a resource type YAML with sandbox_strategy "{strategy}"')
|
||||
def step_yaml_with_sandbox_strategy(context, strategy):
|
||||
context.rt_yaml = f"""
|
||||
name: myorg/test
|
||||
resource_kind: physical
|
||||
sandbox_strategy: {strategy}
|
||||
"""
|
||||
|
||||
|
||||
@then('the loaded schema sandbox_strategy should be "{strategy}"')
|
||||
def step_loaded_schema_sandbox_strategy(context, strategy):
|
||||
assert context.rt_schema.sandbox_strategy == strategy, (
|
||||
f"Expected sandbox_strategy '{strategy}', got '{context.rt_schema.sandbox_strategy}'"
|
||||
)
|
||||
|
||||
@@ -53,6 +53,7 @@ _VALID_STRATEGIES = frozenset(
|
||||
"copy_on_write",
|
||||
"transaction_rollback",
|
||||
"snapshot",
|
||||
"overlay",
|
||||
"none",
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user