Skip to content

Commit

Permalink
Run terraform init in sequence (#4208)
Browse files Browse the repository at this point in the history
Avoid issues when multiple terraform init try to populate plugin cache
at the same time.

https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache

Note: The plugin cache directory is not guaranteed to be concurrency
safe. The provider installer's behavior in environments with multiple
terraform init calls is undefined.

Signed-off-by: Di Wang <[email protected]>
  • Loading branch information
hemslo authored Mar 19, 2024
1 parent 12a3ec9 commit 21c6ffb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reconcile/utils/terraform_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def init_specs(self):
TerraformSpec(name=name, working_dir=wd)
for name, wd in self.working_dirs.items()
]
threaded.run(self.terraform_init, self.specs, self.thread_pool_size)
for spec in self.specs:
self.terraform_init(spec)

@contextmanager
def _terraform_log_file(
Expand Down

0 comments on commit 21c6ffb

Please sign in to comment.