Skip to content

Commit

Permalink
fix(terraform): check if module is local (#1483)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikpivkin authored Oct 24, 2023
1 parent 7ccc467 commit 015ab97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/terraform/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ type Module struct {
modulePath string
ignores Ignores
parent *Module
local bool
}

func NewModule(rootPath string, modulePath string, blocks Blocks, ignores Ignores) *Module {
func NewModule(rootPath string, modulePath string, blocks Blocks, ignores Ignores, local bool) *Module {

blockMap := make(map[string]Blocks)

Expand All @@ -30,6 +31,7 @@ func NewModule(rootPath string, modulePath string, blocks Blocks, ignores Ignore
blockMap: blockMap,
rootPath: rootPath,
modulePath: modulePath,
local: local,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/terraform/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Modules []*Module
func (m Modules) ChildModulesPaths() []string {
var result []string
for _, module := range m {
if module.parent != nil {
if module.parent != nil && module.local {
result = append(result, module.modulePath)
}
}
Expand Down

0 comments on commit 015ab97

Please sign in to comment.