package catalogue import ( "fmt" ) // A module version prepares its state before it runs (novox/hq ADR 0135). // // What the mesh derives is the module's own resource, run once with one word, placed immediately in // front of the thing it prepares for. What matters in these tests is that the derivation is a copy // rather than a second description: the failure it replaces was a hand-written step repeating six // fields of the resource it preceded, each free to drift from it. func aPreparingModule() Manifest { return Manifest{ Module: "gitea", Prepares: true, Resources: []map[string]any{ {"id": "state", "type": "directory", "path": "/var/lib/gitea", "mode": "0700"}, {"id": "server", "type": "container", "name": "mesh-gitea-server", "image": "gitea/gitea@" + digest, "ports": []any{"3000:3000"}}, {"id": "runtime", "type": "container", "name": "mesh-gitea", "image": ArtifactStoreScheme + "gitea/runtime@" + digest, "network": "host", "env": map[string]any{"MESH_GITEA_STATE_DIR": "/run/state"}, "volumes": []any{"/var/lib/gitea:/run/state:ro"}, "ports": []any{"9000:9000"}}, }, } } func idsOf(resources []map[string]any) []string { var ids []string for _, r := range resources { ids = append(ids, fmt.Sprint(r["id"])) } return ids }