catalog: the lifecycle implementation itself (fixes the previous commit)

The previous commit landed only the new test/badge files: a 'git stash' used
to compare REUSE.md ref-check output silently dropped the staged index, so
every modification to an existing file was left behind and that commit does
not build. This adds the metadata field, the predicates, the fail-closed
deploy gate, the catalog filter, the funcmap entries, the template edits and
the docs that those tests exercise.
This commit is contained in:
2026-07-21 16:20:24 +02:00
parent ea0d3f1764
commit 5fdd2039fd
11 changed files with 213 additions and 5 deletions
+10
View File
@@ -160,6 +160,16 @@ func (m *Manager) DeployStack(req DeployRequest) (string, error) {
stackDir := filepath.Dir(stack.ComposePath)
meta := LoadMetadata(stackDir)
// --- Lifecycle gate (defence in depth) ---
// The API handler refuses this first, with the customer-facing Hungarian message. This second
// check exists because DeployStack is the manager-level choke point EVERY caller goes through,
// and metadata is already loaded here — so a future caller that does not route through the API
// cannot bypass the rule by simply not knowing about it. Deliberately before the first mutation.
if !meta.CanInstall() {
clearDeploying()
return "", fmt.Errorf("stack %q is not installable (lifecycle: %s)", req.StackName, meta.EffectiveLifecycle())
}
// --- Memory validation ---
var deployWarning string
reservedMB := m.cfg.System.ReservedMemoryMB