当我运行terraspace bundle
时,我看到以下错误消息:
Bundling with Terrafile...
ERROR: There was a git error
Current dir: /private/tmp/terraspace/bundler/cache/github.com/cloudposse/terraform-aws-cloudfront-s3-cdn
The error occur when running:
git pull 2>&1
fatal: not a git repository (or any of the parent directories): .git
在我的Terrafile中只有某些模块似乎有这个问题,因为我能够通过注释那些失败的模块来绕过这个问题。
我决定在每个故障模块上尝试rm -rf /private/tmp/terraspace/bundler/cache/<module>
。
在我这样做之后,模块正确安装:
Bundling with Terrafile...
Exporting aws-iam-role
Exporting ecr
Exporting iam-system-user
Exporting s3-cdn
Modules saved to vendor/modules
我不确定缓存损坏的根本原因。