-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent parsing of excluded modules #2664
Conversation
globPath = filepath.Join(basePath, globPath) | ||
} | ||
|
||
matches, err := zglob.Glob(globPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the desired behavior here if err
is not nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just skip this globPath as it was before
terragrunt/configstack/module.go
Lines 182 to 187 in 40e0d4b
matches, err := zglob.Glob(absoluteDir) | |
// Skip globs that can not be expanded | |
if err == nil { | |
includeGlobMatches = append(includeGlobMatches, matches...) | |
} |
Perhaps there is a reason for this behaviour, I don't know, but I would check the correctness of this path and return an error in cases of non-existence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should change this behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, no worries! Let's leave it for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment, otherwise LGTM
Thanks for the review @MoonMoon1919! |
Resolved in v0.50.1 release. |
* fix: prevent parsing of excluded modules * fix: unit tests * chore: add unit test --------- Co-authored-by: Levko Himins <[email protected]>
* fix: prevent parsing of excluded modules * fix: unit tests * chore: add unit test --------- Co-authored-by: Levko Himins <[email protected]>
* fix: prevent parsing of excluded modules * fix: unit tests * chore: add unit test --------- Co-authored-by: Levko Himins <[email protected]>
Description
Prevent parsing of excluded modules. For example, these modules may have invalid syntax or incomplete configuration, causing terragrunt to fail when parsed.
Related Issues
Fixes #2167