Skip to content

Instantly share code, notes, and snippets.

@BrianHicks
Created June 24, 2016 14:43
Show Gist options
  • Save BrianHicks/59869277e540fdc5a257330ac93f6de2 to your computer and use it in GitHub Desktop.
Save BrianHicks/59869277e540fdc5a257330ac93f6de2 to your computer and use it in GitHub Desktop.
// ensure that all of a resources dependencies have already run successfully
func checkDeps(graph *Graph, id string, results []*ApplyResult) (failed []string) {
for _, dep := range graph.Depends(id) { // not a huge fan of that name but it's consistent.
for _, result := range results {
if result.Path == dep && !result.Success {
failed = append(failed, result.Path)
}
}
}
return failed
}
// note: this probably could be done inline in Apply. Similar logic should be added to Check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment