Skip to content

Commit

Permalink
update changelog, reverse conditional order
Browse files Browse the repository at this point in the history
  • Loading branch information
dsa0x committed Oct 17, 2024
1 parent ed36a7a commit c3e48c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Unreleased

## Enhancements

* Add support for reading a registry module by its unique identifier by @dsa0x
[#988](https://github.com/hashicorp/go-tfe/pull/988)

# v1.68.0

## Enhancements
Expand Down
6 changes: 3 additions & 3 deletions registry_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,7 @@ func (r *registryModules) Read(ctx context.Context, moduleID RegistryModuleID) (
}

var u string
if moduleID.ExternalID != "" {
u = fmt.Sprintf("registry-modules/%s", url.PathEscape(moduleID.ExternalID))
} else {
if moduleID.ExternalID == "" {
if moduleID.RegistryName == "" {
log.Println("[WARN] Support for using the RegistryModuleID without RegistryName is deprecated as of release 1.5.0 and may be removed in a future version. The preferred method is to include the RegistryName in RegistryModuleID.")
moduleID.RegistryName = PrivateRegistry
Expand All @@ -548,6 +546,8 @@ func (r *registryModules) Read(ctx context.Context, moduleID RegistryModuleID) (
url.PathEscape(moduleID.Name),
url.PathEscape(moduleID.Provider),
)
} else {
u = fmt.Sprintf("registry-modules/%s", url.PathEscape(moduleID.ExternalID))
}

req, err := r.client.NewRequest("GET", u, nil)
Expand Down

0 comments on commit c3e48c4

Please sign in to comment.