-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Sourcing module with git by cloning in shallow mode #10703
Comments
Related #14036 |
also having this issue. |
Related #19277 |
Currently using Example module "test" {
source="git::[email protected]:czerasz/terraform-aws-container-override.git?depth=1&ref=tags/v0.1.0"
} The ...
Error: Failed to download module
Could not download module "test" (main.tf:1) source code from
"git::[email protected]:czerasz/terraform-aws-container-override.git?depth=1&ref=tags/v0.1.0":
error downloading
'ssh://[email protected]/czerasz/terraform-aws-container-override.git?depth=1&ref=tags%2Fv0.1.0':
/usr/bin/git exited with 1: error: pathspec 'tags/v0.1.0' did not match any
file(s) known to git. This is because Terraform (through the
The problem is that by using $ cd .terraform/modules/test
$ git tag | cat
v0.1.1 |
Ah, yeah, I see. You've asked for tag=123 with a depth=1, and gotten tag=125, and of course no other tags. Have you tried reversing the URL query fields, just as a test? |
@in4mer I tried reversing the fields, but it's not relevant. The issue is, as You mentioned, there is no history besides "now." |
Could the clone command just add https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt--bltnamegt |
I opened a PR to fix this, although I'm not sure if I was supposed to open it for go-getter or terraform 😕 |
Would be definitely nice to see this. Quite a bummer that using depth in combination with ref is not working. |
Have we tried using the full git refspec for this? Using a ref of This is explained in the git manual
Using the full |
With terraform we can't specify the full |
But this PR may fix this bug: hashicorp/go-getter#266 or hashicorp/go-getter#266 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Hi there,
We have a heavy git repository with a lot of Terraform modules. When we execute a
terraform get
it take ~20min to download dependencies (a git clone for each module call !).We removed from the repository some binary files on the master branch. But unfortunately, nothing changed because Terraform do a
git clone
instead ofgit clone --depth 1
.The text was updated successfully, but these errors were encountered: