Replies: 2 comments 3 replies
-
|
I've been working on this and propose that namespaces will be part of release 0.10.0. This release will then only support Terraform 0.13.x and (presumably) later. The list of providers that are going to be supported can be found here. Don't use this branch yet as it is still quite a mess!!! There are some quirks (bugs?) with the Terraform Provider Registry API where it does not include all providers. For example, https://registry.terraform.io/v1/providers/hashicorp?limit=100 does not include the Thus the rewritten |
Beta Was this translation helpful? Give feedback.
-
|
See also issue #138. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Terraform 0.13 (earlier?) introduced the concept of provider namespaces. The basic idea is that if two providers have the same name they can be distinguished by their namespace as shown in the example from Terraform Provider Requirements. The question is how to reflect this in Terraform.
I came across this while I was re-writing
makecode.pyto query the Terraform Provider Registry. The registry lists multiple "null" providers (https://registry.terraform.io/search/providers?q=null). In it's current state,makecode.pywill actually overwrite a previously created file (terrascript/providers/null.pyin this case) if it processes another provider with the same name as it is not aware of namespaces. This is clearly a bug.Takin the "null" providers as an example, in order to make Terrascript support namespaces, the module layout probably would have to be restructured like this.
terrascript/providers/hashicorp/null.pyimport terrascript.providers.hashicorp.nullterrascript/providers/mildred/null.pyimport terrascript.providers.mildred.nullterrascript/providers/paultyng/null.pyimport terrascript.providers.paultyng.nullObviously this breaks backwards compatibility where people are used to write the import statement without a namespace level.
A possible work-around for this would be to continue making some providers available without the namespace level. Preference would be based on Terraform Registry tier levels: "official" is higher than "verified" which is higher than "community", e.g.
import terrascript.providers.null(short-cut forimport terrascript.providers.hashicorp.null)import terrascript.providers.hashicorp.nullimport terrascript.providers.mildred.nullimport terrascript.providers.paultyng.nullI am happy to discuss this here.
Beta Was this translation helpful? Give feedback.
All reactions