Skip to content

Commit 3613591

Browse files
Merge pull request #1126 from hashicorp/WAYP-3564-read-module-url
Use go-tfe client address for registry URL
2 parents d64cb3c + 66234e7 commit 3613591

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* Adds BETA support for speculative runs with `Stacks` resources and removes VCS repo validity check on `Stack` creation, which is EXPERIMENTAL, SUBJECT TO CHANGE, and may not be available to all users by @hwatkins05-hashicorp [#1119](https://github.com/hashicorp/go-tfe/pull/1119)
1111
* Adds support for listing team tokens, by @mkam [#1109](https://github.com/hashicorp/go-tfe/pull/1109)
1212

13+
## Bug Fixes
14+
15+
* Fixes hard coded public terraform registry URL for ReadTerraformRegistryModule, by @paladin-devops [#1126](https://github.com/hashicorp/go-tfe/pull/1126)
16+
1317
# v1.81.0
1418

1519
## Enhancements

registry_module.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -635,18 +635,17 @@ func (r *registryModules) Read(ctx context.Context, moduleID RegistryModuleID) (
635635
return rm, nil
636636
}
637637

638-
// ReadRegistry fetches a registry module from the Terraform Registry.
638+
// ReadTerraformRegistryModule fetches a registry module from the Terraform Registry.
639639
func (r *registryModules) ReadTerraformRegistryModule(ctx context.Context, moduleID RegistryModuleID, version string) (*TerraformRegistryModule, error) {
640-
u := fmt.Sprintf(
641-
"https://app.terraform.io/api/registry/v1/modules/%s/%s/%s/%s",
640+
u := fmt.Sprintf("api/registry/v1/modules/%s/%s/%s/%s",
642641
moduleID.Namespace,
643642
moduleID.Name,
644643
moduleID.Provider,
645644
version,
646645
)
646+
647647
if moduleID.RegistryName == PublicRegistry {
648-
u = fmt.Sprintf(
649-
"https://app.terraform.io/api/registry/public/v1/modules/%s/%s/%s/%s",
648+
u = fmt.Sprintf("api/registry/public/v1/modules/%s/%s/%s/%s",
650649
moduleID.Namespace,
651650
moduleID.Name,
652651
moduleID.Provider,

0 commit comments

Comments
 (0)