-
-
Notifications
You must be signed in to change notification settings - Fork 997
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
Terragrunt catalog command clones repos on every invocation #3532
Comments
Hey @tgeijg , Thanks for submitting this issue! At the very least, our logs will need updating if we're avoiding the secondary clone, but reporting it as another clone. Marking this issue as |
Hi @yhakbar Just to add some more info: Out of curiosity I ran some test with a few more repos - 40 to be exact - in the catalog config. Results below:
Or in short, three consecutive runs ran within a few seconds of each other. It sure doesn't seem to be significantly faster on the second run
|
I believe you that we have a bug preventing re-use of already cloned modules. My guess as to the origin of this bug is that we initially cloned once, but users wanted to allow catalogs to update without changing URLs. We could have introduced logic to use Again, this is just a guess, but it would be plausible to me if that was the case. I think a solution that would be better than saving a stashed clone of each ref would be to use something like this: The problem with storing a stashed clone of each ref is that there would be no space savings between updates. If you are using the default branch of a Catalog URL as the source of your catalog, then changing one file in your repo would result in an almost entirely duplicate copy of your repo on disk. I would assume that most users would prefer a Content Addressable Store (CAS) to store an immutable read-only copy of every object in the repo, and to use that when perusing the catalog. Would you agree with that? If so, I'm not sure when we would get to that, but that's the design we'd use for the final implementation. |
That's a pretty neat idea @yhakbar. And yes, I do think that would be a better approach in this case. |
Describe the bug
According to the Medium article on terragrunt catalog the command should only clone the configured repos on the first invocation.
The docs are a little more vague as they just say the repos are cloned into a temporary folder.
Steps To Reproduce
Using the example from the Medium article above, if I add the catalog config to the root terragrunt file in our infra repo
The results I'm seeing are that the repos are cloned (into the same temporary folder) on each catalog invocation.
Expected behavior
On second catalog invocation the repositories should not be cloned again (into the same temporary folder).
Either the Medium article is incorrect, I'm doing something wrong, or this is a bug.
Versions
The text was updated successfully, but these errors were encountered: