store: add function to get blueprint changes

For a given blueprint name the store returns a list of the changes made
to that blueprint.
This commit is contained in:
Jacob Kozol 2019-11-12 13:47:35 +01:00 committed by Tom Gundersen
parent 7d2650a2e3
commit 080bd4968c

View file

@ -368,6 +368,19 @@ func (s *Store) GetBlueprintCommitted(name string, bp *blueprint.Blueprint) bool
return true
}
func (s *Store) GetBlueprintChanges(name string) []blueprint.Change {
s.mu.RLock()
defer s.mu.RUnlock()
var changes []blueprint.Change
for _, change := range s.BlueprintsChanges[name] {
changes = append(changes, change)
}
return changes
}
func (s *Store) PushBlueprint(bp blueprint.Blueprint) {
s.change(func() error {
hash := sha1.New()