generator: третий режим destroy keep_on_destroy (state_only) для всех instance-ресурсов + предупреждения «заморожен/оставлен как есть»

This commit is contained in:
Nail
2026-09-24 19:06:40 +03:00
parent 0de72e09f0
commit 22c6c83a0f
3 changed files with 49 additions and 21 deletions
@@ -116,6 +116,11 @@ func LoadSpecs(dir string) ([]types.GenResource, []types.GenSubresource, []types
suspendOnDestroy = *spec.Lifecycle.SuspendOnDestroyDefault
}
keepOnDestroy := false
if spec.Lifecycle.KeepOnDestroyDefault != nil {
keepOnDestroy = *spec.Lifecycle.KeepOnDestroyDefault
}
gr := types.GenResource{
Name: spec.Name,
ServiceID: spec.ServiceID,
@@ -128,6 +133,7 @@ func LoadSpecs(dir string) ([]types.GenResource, []types.GenSubresource, []types
HasRefSvcParams: HasRefSvcParams(schemaParams),
SupportsSuspendDestroy: supportsSuspendDestroy,
SuspendOnDestroy: suspendOnDestroy,
KeepOnDestroy: keepOnDestroy,
AdoptExistingOnCreate: adoptExistingOnCreate,
HasDomainParam: hasDomainParam,
}