diff --git a/features/consolidated_resource.feature b/features/consolidated_resource.feature index bb74d8fa7..977d2a2a9 100644 --- a/features/consolidated_resource.feature +++ b/features/consolidated_resource.feature @@ -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" diff --git a/features/steps/resource_type_model_steps.py b/features/steps/resource_type_model_steps.py index 9c8e64efc..b0eafafac 100644 --- a/features/steps/resource_type_model_steps.py +++ b/features/steps/resource_type_model_steps.py @@ -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}'" + ) diff --git a/src/cleveragents/resource/schema.py b/src/cleveragents/resource/schema.py index da0dfe5cd..39b3cb1eb 100644 --- a/src/cleveragents/resource/schema.py +++ b/src/cleveragents/resource/schema.py @@ -53,6 +53,7 @@ _VALID_STRATEGIES = frozenset( "copy_on_write", "transaction_rollback", "snapshot", + "overlay", "none", } )