Skip to content
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

Open
tgeijg opened this issue Nov 4, 2024 · 1 comment
Open

Terragrunt catalog command clones repos on every invocation #3532

tgeijg opened this issue Nov 4, 2024 · 1 comment
Labels
bug Something isn't working preserved Preserved issues never go stale

Comments

@tgeijg
Copy link

tgeijg commented Nov 4, 2024

Describe the bug

According to the Medium article on terragrunt catalog the command should only clone the configured repos on the first invocation.

Note: the catalog command will git clone the repos locally, so the first run may take a little while if you have lots of repos, but it should be much faster on all re-runs.

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

catalog {
  urls = [
    "https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example",
    "https://github.com/gruntwork-io/terraform-aws-utilities",
    "https://github.com/gruntwork-io/terraform-kubernetes-namespace"
  ]
}

The results I'm seeing are that the repos are cloned (into the same temporary folder) on each catalog invocation.

❯ tg catalog
10:35:12.380 INFO   Cloning repository "git::https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example.git" to temporary directory "/var/folders/s3/zm9trzfs4cd6900ws1qhvfdh0000gp/T/catalog5a5f7a556b6a764d7757384d7a55516e437742456d616f6f413577/terragrunt-infrastructure-modules-example"
10:35:13.762 INFO   Found 5 modules in repository "https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example"
10:35:13.762 INFO   Cloning repository "git::https://github.com/gruntwork-io/terraform-aws-utilities.git" to temporary directory "/var/folders/s3/zm9trzfs4cd6900ws1qhvfdh0000gp/T/catalog4e5732674b627567715f364f6947554c45717a7a4132514766714d/terraform-aws-utilities"
10:35:16.613 INFO   Found 11 modules in repository "https://github.com/gruntwork-io/terraform-aws-utilities"
10:35:16.613 INFO   Cloning repository "git::https://github.com/gruntwork-io/terraform-kubernetes-namespace.git" to temporary directory "/var/folders/s3/zm9trzfs4cd6900ws1qhvfdh0000gp/T/catalog69625338504b4c684c66353434305f45594d486c74495a4d725959/terraform-kubernetes-namespace"
10:35:17.728 INFO   Found 4 modules in repository "https://github.com/gruntwork-io/terraform-kubernetes-namespace"
❯
❯ tg catalog
10:35:20.898 INFO   Cloning repository "git::https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example.git" to temporary directory "/var/folders/s3/zm9trzfs4cd6900ws1qhvfdh0000gp/T/catalog5a5f7a556b6a764d7757384d7a55516e437742456d616f6f413577/terragrunt-infrastructure-modules-example"
10:35:23.323 INFO   Found 5 modules in repository "https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example"
10:35:23.323 INFO   Cloning repository "git::https://github.com/gruntwork-io/terraform-aws-utilities.git" to temporary directory "/var/folders/s3/zm9trzfs4cd6900ws1qhvfdh0000gp/T/catalog4e5732674b627567715f364f6947554c45717a7a4132514766714d/terraform-aws-utilities"
10:35:27.127 INFO   Found 11 modules in repository "https://github.com/gruntwork-io/terraform-aws-utilities"
10:35:27.127 INFO   Cloning repository "git::https://github.com/gruntwork-io/terraform-kubernetes-namespace.git" to temporary directory "/var/folders/s3/zm9trzfs4cd6900ws1qhvfdh0000gp/T/catalog69625338504b4c684c66353434305f45594d486c74495a4d725959/terraform-kubernetes-namespace"
10:35:29.149 INFO   Found 4 modules in repository "https://github.com/gruntwork-io/terraform-kubernetes-namespace"

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

  • Terragrunt version: v0.68.4
@tgeijg tgeijg added the bug Something isn't working label Nov 4, 2024
@yhakbar
Copy link
Collaborator

yhakbar commented Nov 22, 2024

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 preserved so that it doesn't go stale. Definitely worth addressing.

@yhakbar yhakbar added stale Stale preserved Preserved issues never go stale and removed stale Stale labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preserved Preserved issues never go stale
Projects
None yet
Development

No branches or pull requests

2 participants