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

-enable-plugin-cache flag not functioning #35266

Open
lijok opened this issue May 31, 2024 · 1 comment
Open

-enable-plugin-cache flag not functioning #35266

lijok opened this issue May 31, 2024 · 1 comment
Labels
bug new new issue not yet triaged v1.8 Issues (primarily bugs) reported against v1.8 releases waiting-response An issue/pull request is waiting for a response from the community

Comments

@lijok
Copy link

lijok commented May 31, 2024

Terraform Version

Terraform v1.8.4
on darwin_arm64

Terraform Configuration Files

terraform {
  required_version = "= 1.8.4"

  required_providers {
    aws = {
      source  = "registry.terraform.io/hashicorp/aws"
      version = "= 5.52.0"
    }

  backend "local" {}
}

Debug Output

N/A

Expected Behavior

Plugins should be fetched from cache

Actual Behavior

Plugins are being fetched from remote

Steps to Reproduce

  1. export TF_PLUGIN_CACHE_DIR="$HOME/.terraform.d/plugin-cache"
  2. terraform init
  3. terraform providers lock -enable-plugin-cache

Additional Context

No response

References

#34632

@lijok lijok added bug new new issue not yet triaged labels May 31, 2024
@jbardin
Copy link
Member

jbardin commented Jun 17, 2024

Hi @lijok,

Thanks for filing the issue. The providers lock command can't create a complete lock file from the cache, since it does not contain the hashes for all architectures, so it's not clear how you would use -enable-plugin-cache if the lock file can't be generated. I'm not sure exactly what was intended with the referenced PR, but also setting TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE=true should allow the creation of a lock file only containing the cached binary, which is what I assume you're trying to do.

@crw crw added the waiting-response An issue/pull request is waiting for a response from the community label Jun 17, 2024
@apparentlymart apparentlymart added the v1.8 Issues (primarily bugs) reported against v1.8 releases label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new new issue not yet triaged v1.8 Issues (primarily bugs) reported against v1.8 releases waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

No branches or pull requests

4 participants