engine: resources: Receive keys should match mcl, not golang

The capitalization of these keys was wrong and they weren't getting
seen. Add a test as well.
This commit is contained in:
James Shubin
2024-01-19 18:52:31 -05:00
parent b670bb8d2c
commit 32916f9a6f
8 changed files with 65 additions and 17 deletions

View File

@@ -678,10 +678,10 @@ receiving one. This can _only_ be done inside of the `CheckApply` function!
```golang
// inside CheckApply, probably near the top
if val, exists := obj.init.Recv()["SomeKey"]; exists {
obj.init.Logf("the SomeKey param was sent to us from: %s.%s", val.Res, val.Key)
if val, exists := obj.init.Recv()["some_key"]; exists {
obj.init.Logf("the some_key param was sent to us from: %s.%s", val.Res, val.Key)
if val.Changed {
obj.init.Logf("the SomeKey param was just updated!")
obj.init.Logf("the some_key param was just updated!")
// you may want to invalidate some local cache
}
}