Skip to content

Commit

Permalink
Merge pull request #517 from runatlantis/terragrunt-cache
Browse files Browse the repository at this point in the history
Ignore .terragrunt-cache dirs.
  • Loading branch information
lkysow authored Mar 6, 2019
2 parents 4c887f1 + 36925b4 commit 9845b9a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/events/pending_plan_finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func (p *DefaultPendingPlanFinder) findWithAbsPaths(pullDir string) ([]PendingPl
}
for _, file := range strings.Split(string(lsOut), "\n") {
if filepath.Ext(file) == ".tfplan" {
// Ignore .terragrunt-cache dirs (#487)
if strings.Contains(file, ".terragrunt-cache/") {
continue
}

repoRelDir := filepath.Dir(file)
plans = append(plans, PendingPlan{
RepoDir: repoDir,
Expand Down
24 changes: 24 additions & 0 deletions server/events/pending_plan_finder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,30 @@ func TestPendingPlanFinder_Find(t *testing.T) {
},
},
},
{
".terragrunt-cache",
map[string]interface{}{
"default": map[string]interface{}{
".terragrunt-cache": map[string]interface{}{
"N6lY9xk7PivbOAzdsjDL6VUFVYk": map[string]interface{}{
"K4xpUZI6HgUF-ip6E1eib4L8mwQ": map[string]interface{}{
"app": map[string]interface{}{
"default.tfplan": nil,
},
},
},
},
"default.tfplan": nil,
},
},
[]events.PendingPlan{
{
RepoDir: "???/default",
RepoRelDir: ".",
Workspace: "default",
},
},
},
}

pf := &events.DefaultPendingPlanFinder{}
Expand Down

0 comments on commit 9845b9a

Please sign in to comment.