resources: Polish the password PoC and build out send/recv
This polishes the password resource so that it can actually avoid writing the password to disk, and so that the work actually happens in CheckApply where it can properly interact with the graph. This resource now re-generates the password when it receives a notification. The send/recv plumbing has been extended so that receivers can detect when they're receiving new values. This is particularly important if they might otherwise not expect those values to change and cache them for efficiency purposes.
This commit is contained in:
@@ -174,9 +174,9 @@ func (g *Graph) Process(v *Vertex) error {
|
||||
obj.SetState(resources.ResStateCheckApply)
|
||||
|
||||
// connect any senders to receivers and detect if values changed
|
||||
if changed, err := obj.SendRecv(obj); err != nil {
|
||||
if updated, err := obj.SendRecv(obj); err != nil {
|
||||
return errwrap.Wrapf(err, "could not SendRecv in Process")
|
||||
} else if changed {
|
||||
} else if len(updated) > 0 {
|
||||
obj.StateOK(false) // invalidate cache, mark as dirty
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user