Skip to content

Commit

Permalink
fix: don't skip modules with multiple tf files
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Aug 18, 2024
1 parent fc8572e commit 2208eff
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions internal/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ func find(ctx context.Context, workdir internal.Workdir) (<-chan Options, <-chan
Backend: backend,
}
}()
// Skip walking remainder of parent directory
return fs.SkipDir
}
// Abort walk if context canceled
select {
Expand Down
3 changes: 2 additions & 1 deletion internal/module/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ func TestFindModules(t *testing.T) {
got = append(got, opts)
}

assert.Equal(t, 5, len(got), got)
assert.Equal(t, 6, len(got), got)
assert.Contains(t, got, Options{Path: "with_local_backend", Backend: "local"})
assert.Contains(t, got, Options{Path: "with_s3_backend", Backend: "s3"})
assert.Contains(t, got, Options{Path: "with_cloud_backend", Backend: "cloud"})
assert.Contains(t, got, Options{Path: "terragrunt_with_local", Backend: "local"})
assert.Contains(t, got, Options{Path: "terragrunt_without_backend", Backend: ""})
assert.Contains(t, got, Options{Path: "multiple_tf_files", Backend: "local"})
assert.NotContains(t, got, "broken")

// Expect one error from broken module then error channel should close
Expand Down
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions internal/module/testdata/modules/multiple_tf_files/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
backend "local" {}
}
Empty file.

0 comments on commit 2208eff

Please sign in to comment.