package resolution import ( "strings" "testing" mcat "git.novox.be/novox/mesh-sdk/go/catalogue" ) func TestAScheduledContainerRendersWithTheCronField(t *testing.T) { // The resolver carries `schedule` into the rendered host declaration untouched, exactly as it // carries run-once — a container's keys are copied through, so the host receives the field as // written. digest := "@sha256:" + strings.Repeat("a", 64) r := mcat.Resolution{Node: "laptop", Modules: []mcat.Manifest{{ Module: "kometa", Resources: []map[string]any{ {"id": "sync", "type": "container", "name": "sync", "image": "registry.example/runtime" + digest, "schedule": "0 3 * * *"}, }, }}} out, err := Declaration(r, mcat.Rendering{}) if err != nil { t.Fatal(err) } sync := indexOfID(out, "kometa.sync") if sync == -1 { t.Fatal("the scheduled container was lost in rendering") } if got, _ := out[sync]["schedule"].(string); got != "0 3 * * *" { t.Errorf("schedule did not reach the host declaration: %+v", out[sync]) } }