-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(terraform): Handled git external module loading with sub-directory but without protocol #7272
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
fix(terraform): Handled git external module loading with sub-directory but without protocol #7272
Conversation
…ectory with no protocol
headers: dict[str, Any], | ||
payload: dict[str, Any] | None = None, | ||
) -> ClientResponse: | ||
from checkov.common.util import env_vars_config |
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.
this import moved due to an import loop of env_var_config
and http_utils
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.
nice!
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.
LGTM
if len(module_source_components) < 3: | ||
root_module = module_source_components[-1] | ||
inner_module = "" | ||
if len(module_source_components) == 2 and "git::git" in module_source_components[0]: |
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.
I think it would be helpful if we had a comment here (and in other places in this method) which would explain which use case it solves.
i.e. in this case if I got it right it would be
// git::git@github.com:test-inner-module/out-module//inner-module?ref=main
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.
Added :)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
Handled git external module loading with sub-directory but without protocol, specifically when using
git::git
rather thangit::https://...
(or any other protocol instead of https).This makes sure we correctly parse the sub-directory inside the source url.
Checklist: