Skip to content

Commit

Permalink
Merged automatically by CI pipeline
Browse files Browse the repository at this point in the history
SCALRCORE-22522 API > Return a module latest version despite a status
  • Loading branch information
emocharnik committed Oct 18, 2022
2 parents 55369f2 + 4e72aec commit c4c8d78
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **New data source:** `scalr_variables` ([#176](https://github.com/Scalr/terraform-provider-scalr/pull/176))
- `scalr_environment`: added new attribute `tag_ids` ([#174](https://github.com/Scalr/terraform-provider-scalr/pull/174))
- `data.scalr_environment`: added new attribute `tag_ids` ([#174](https://github.com/Scalr/terraform-provider-scalr/pull/174))
- `module_verion`: data source: change relation from latest-module-version to module-version ([#181](https://github.com/Scalr/terraform-provider-scalr/pull/181))

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require (
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
github.com/scalr/go-scalr v0.0.0-20221017093222-a55f66132481
github.com/scalr/go-scalr v0.0.0-20221018111344-50c95bd1d8a5
)

require (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ github.com/scalr/go-scalr v0.0.0-20221013183921-cfda501ccab8 h1:ghmHzTKdE/TIoxS2
github.com/scalr/go-scalr v0.0.0-20221013183921-cfda501ccab8/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE=
github.com/scalr/go-scalr v0.0.0-20221017093222-a55f66132481 h1:2k89jDfme5jPSUxp+TOBku3tryg/C0jEyoVjz+acyxU=
github.com/scalr/go-scalr v0.0.0-20221017093222-a55f66132481/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE=
github.com/scalr/go-scalr v0.0.0-20221018080206-684a28861661 h1:Wy4z0usRJGlDy36hUzWlwhgdJNsh/qIFyqyzK8/mJUE=
github.com/scalr/go-scalr v0.0.0-20221018080206-684a28861661/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE=
github.com/scalr/go-scalr v0.0.0-20221018111344-50c95bd1d8a5 h1:ke3zsSFOV1wCFR7PBIx91f0xf8DgZzGYmPYTARWgOJk=
github.com/scalr/go-scalr v0.0.0-20221018111344-50c95bd1d8a5/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
Expand Down
4 changes: 2 additions & 2 deletions scalr/data_source_module_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func dataSourceModuleVersionRead(d *schema.ResourceData, meta interface{}) error
version = v.(string)
mv, err = scalrClient.ModuleVersions.ReadBySemanticVersion(ctx, module.ID, version)
} else {
if module.LatestModuleVersion == nil {
if module.ModuleVersion == nil {
return errors.New("The module has no version tags")
}
mv, err = scalrClient.ModuleVersions.Read(ctx, module.LatestModuleVersion.ID)
mv, err = scalrClient.ModuleVersions.Read(ctx, module.ModuleVersion.ID)
}

if err != nil {
Expand Down

0 comments on commit c4c8d78

Please sign in to comment.