engine: Create a resource kind+name specific stateful store

This adds a meta state store that is preserved between graph switches if
the kind and name match. This is useful so that rapid graph changes
don't necessarily reset their retry count if they've only changed one
resource field.
This commit is contained in:
James Shubin
2023-09-01 20:45:12 -04:00
parent 07bd8afc4a
commit 9545e409d4
7 changed files with 106 additions and 1 deletions

View File

@@ -1749,3 +1749,20 @@ func TestResources2(t *testing.T) {
})
}
}
func TestResPtrUID1(t *testing.T) {
t1, err := engine.NewNamedResource("test", "test1")
if err != nil {
t.Errorf("could not build resource: %+v", err)
return
}
t2, err := engine.NewNamedResource("test", "test1")
if err != nil {
t.Errorf("could not build resource: %+v", err)
return
}
if uid1, uid2 := engine.PtrUID(t1), engine.PtrUID(t2); uid1 != uid2 {
t.Errorf("uid's don't match")
}
}