From 080bd4968c85103fe7f69d54ed38fcb8c7605fcc Mon Sep 17 00:00:00 2001 From: Jacob Kozol Date: Tue, 12 Nov 2019 13:47:35 +0100 Subject: [PATCH] store: add function to get blueprint changes For a given blueprint name the store returns a list of the changes made to that blueprint. --- internal/store/store.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/store/store.go b/internal/store/store.go index 4d4504347..aefa11ce1 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -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()