fix(controlplane): stored container policies replace file profiles; add profile image and workflow examples

A stored container-runtime-policies document that carries Profiles now
replaces the file's profiles instead of merging into them, so a profile
deleted in the dashboard stays deleted; one stored before profiles existed
still inherits the file's. Profiles drop their json tags so the stored
document keys them like its other fields.

Adds examples/profiles/Dockerfile.agent-net (agent image plus network
lookup tools) with a build-only agent-net compose service,
examples/workflows/firewall-investigate.yaml with a test that parses every
example against the registered step vocabulary, and names the postgres
service in the compose header.
This commit is contained in:
sam committed 2026-09-24 20:58:08 +10:00
1 parent 7b7aa62c28
commit 4046766abe
8 files changed
+128 -7

No files matched your search

@@ -1,6 +1,8 @@
package workflowsteps
import (
"os"
"path/filepath"
"slices"
"strings"
"testing"
@@ -189,3 +191,26 @@ func TestRepoHookStepsCompileThroughTheManager(t *testing.T) {
t.Fatalf("ParseAndCompile(%q) error = %v, want the unusable rule refused by name", broken, err)
}
}
// The shipped example workflows parse against the vocabulary the roots
// register, so an example cannot drift from the steps that exist.
func TestExampleWorkflowsParse(t *testing.T) {
paths, err := filepath.Glob("../../../examples/workflows/*.yaml")
if err != nil || len(paths) == 0 {
t.Fatalf("no example workflows found: %v", err)
}
manager, err := NewManager()
if err != nil {
t.Fatal(err)
}
registry := manager.Registry()
for _, path := range paths {
src, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
if _, err := workflow.ParseDefinition(string(src), registry); err != nil {
t.Errorf("%s: %v", path, err)
}
}
}