0.13 beta2 vendored providers

Provider is here:
./terraform.d/plugins/example.com/vendor/onepassword/v0.6.3/darwin_amd64/terraform-provider-onepassword_v0.6.3

And sourced like this:

terraform {
  required_providers {
    onepassword = {
       source = "example.com/vendor/onepassword"
       version = "0.6.3"
    }
  }
}

I’ve looked at the docs here: https://gist.github.com/mildwonkey/54ce5cf5283d9ea982d952e3c04a5956 and https://github.com/hashicorp/terraform/blob/guide-v0.13-beta/draft-upgrade-guide.md#new-filesystem-layout-for-local-copies-of-providers

As well as reviewing some related issues and PRs on GitHub.

Note: I’ve replaced references to my company domain with example.com

$ terraform init
2020/06/17 18:09:58 [INFO] Terraform version: 0.13.0 beta2
2020/06/17 18:09:58 [INFO] Go runtime version: go1.14.2
2020/06/17 18:09:58 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/2.0.0/versions/0.13.0-beta2/terraform", "init"}
2020/06/17 18:09:58 [DEBUG] Attempting to open CLI config file: /Users/matt/.terraformrc
2020/06/17 18:09:58 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/06/17 18:09:58 [DEBUG] will search for provider plugins in terraform.d/plugins
2020/06/17 18:09:58 [DEBUG] ignoring non-existing provider search directory /Users/matt/.terraform.d/plugins
2020/06/17 18:09:58 [DEBUG] ignoring non-existing provider search directory /Users/matt/Library/Application Support/io.terraform/plugins
2020/06/17 18:09:58 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2020/06/17 18:09:58 [INFO] CLI command args: []string{"init"}
2020/06/17 18:09:58 [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules
Initializing modules...
2020/06/17 18:09:58 [DEBUG] Module installer: begin k8svnet
2020/06/17 18:09:58 [TRACE] ModuleInstaller: Module installer: k8svnet <nil> already installed in ../modules/masteryvnet
2020/06/17 18:09:58 [DEBUG] Module installer: begin kubectl
2020/06/17 18:09:58 [TRACE] ModuleInstaller: Module installer: kubectl <nil> already installed in ../modules/test
2020/06/17 18:09:58 [DEBUG] Module installer: begin masteryk8s
2020/06/17 18:09:58 [TRACE] ModuleInstaller: Module installer: masteryk8s <nil> already installed in ../modules/masteryk8s
2020/06/17 18:09:58 [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json

Initializing the backend...
2020/06/17 18:09:58 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/06/17 18:09:58 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/06/17 18:09:58 [DEBUG] New state was assigned lineage "0bb35e91-ce2d-18dd-036d-d3b063fae6cc"
2020/06/17 18:09:58 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2020/06/17 18:09:58 [TRACE] Meta.Backend: instantiated backend of type <nil>
2020/06/17 18:09:58 [TRACE] providercache.fillMetaCache: scanning directory .terraform/plugins
2020/06/17 18:09:58 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/azuread v0.10.0 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/azuread/0.10.0/darwin_amd64
2020/06/17 18:09:58 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/azurerm v2.14.0 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/azurerm/2.14.0/darwin_amd64
2020/06/17 18:09:58 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/null v2.1.2 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/null/2.1.2/darwin_amd64
2020/06/17 18:09:58 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/random v2.2.1 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/random/2.2.1/darwin_amd64
2020/06/17 18:09:58 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/random/2.2.1/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/random 2.2.1
2020/06/17 18:09:58 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/azuread/0.10.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/azuread 0.10.0
2020/06/17 18:09:58 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/azurerm/2.14.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/azurerm 2.14.0
2020/06/17 18:09:58 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/null/2.1.2/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/null 2.1.2
2020/06/17 18:09:58 [TRACE] providercache.fillMetaCache: using cached result from previous scan of .terraform/plugins
2020/06/17 18:09:58 [TRACE] providercache.fillMetaCache: using cached result from previous scan of .terraform/plugins
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: using cached result from previous scan of .terraform/plugins
2020/06/17 18:09:59 [DEBUG] checking for provisioner in "."
2020/06/17 18:09:59 [DEBUG] checking for provisioner in "/usr/local/Cellar/tfenv/2.0.0/versions/0.13.0-beta2"
2020/06/17 18:09:59 [DEBUG] checking for provisioner in "terraform.d/plugins/darwin_amd64"
2020/06/17 18:09:59 [DEBUG] checking for provisioner in ".terraform/plugins/darwin_amd64"
2020/06/17 18:09:59 [TRACE] Meta.Backend: backend <nil> does not support operations, so wrapping it in a local backend
2020/06/17 18:09:59 [TRACE] backend/local: state manager for workspace "default" will:
 - read initial snapshot from terraform.tfstate
 - write new snapshots to terraform.tfstate
 - create any backup at terraform.tfstate.backup
2020/06/17 18:09:59 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2020/06/17 18:09:59 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2020/06/17 18:09:59 [TRACE] statemgr.Filesystem: read nil snapshot

2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: scanning directory .terraform/plugins
Initializing provider plugins...
2020/06/17 18:09:59 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/azuread v0.10.0 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/azuread/0.10.0/darwin_amd64
2020/06/17 18:09:59 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/azurerm v2.14.0 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/azurerm/2.14.0/darwin_amd64
2020/06/17 18:09:59 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/null v2.1.2 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/null/2.1.2/darwin_amd64
2020/06/17 18:09:59 [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/random v2.2.1 for darwin_amd64 at .terraform/plugins/registry.terraform.io/hashicorp/random/2.2.1/darwin_amd64
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/null/2.1.2/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/null 2.1.2
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/random/2.2.1/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/random 2.2.1
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/azuread/0.10.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/azuread 0.10.0
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: including .terraform/plugins/registry.terraform.io/hashicorp/azurerm/2.14.0/darwin_amd64 as a candidate package for registry.terraform.io/hashicorp/azurerm 2.14.0
- Using previously-installed hashicorp/azuread v0.10.0
2020/06/17 18:09:59 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
- Using previously-installed hashicorp/azurerm v2.14.0
2020/06/17 18:09:59 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
- Using previously-installed hashicorp/random v2.2.1
- Using previously-installed hashicorp/null v2.1.2
- Finding latest version of hashicorp/kubectl...
2020/06/17 18:09:59 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/kubectl/versions
2020/06/17 18:09:59 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/hashicorp/kubectl/versions
2020/06/17 18:09:59 [DEBUG] Service discovery for example.com at https://example.com/.well-known/terraform.json
2020/06/17 18:09:59 [TRACE] HTTP client GET request to https://example.com/.well-known/terraform.json
- Finding example.com/vendor/onepassword versions matching "0.6.3"...
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: using cached result from previous scan of .terraform/plugins
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: using cached result from previous scan of .terraform/plugins
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: using cached result from previous scan of .terraform/plugins
2020/06/17 18:09:59 [TRACE] providercache.fillMetaCache: using cached result from previous scan of .terraform/plugins
2020/06/17 18:10:00 [DEBUG] GET https://registry.terraform.io/v1/providers/-/kubectl/versions
2020/06/17 18:10:00 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/kubectl/versions

Hi @matthewi!

I’m afraid I think you’ve found an error in the upgrade guide: Terraform doesn’t expect to see a v prefix on the version number directory name, but I can see that the draft upgrade guide includes one.

I think if you rename that v0.6.3 directory to 0.6.3 then Terraform should be able to discover it:

terraform.d/plugins/example.com/vendor/onepassword/0.6.3/darwin_amd64/terraform-provider-onepassword_v0.6.3