From 5ba17198ffb493799f33cdc1b9328445bf7fa392 Mon Sep 17 00:00:00 2001 From: Roman Mytsko Date: Wed, 5 Oct 2022 17:11:45 +0300 Subject: [PATCH 1/7] SCALRCORE-22522 add module-version field [API_BRANCH] [DB_BRANCH] --- go.mod | 2 +- go.sum | 2 ++ scalr/data_source_module_version.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2df76bb7..8677d600 100644 --- a/go.mod +++ b/go.mod @@ -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-20220927174642-596836aea01f + github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205 ) require ( diff --git a/go.sum b/go.sum index 478f44b9..a58b5f68 100644 --- a/go.sum +++ b/go.sum @@ -302,6 +302,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/scalr/go-scalr v0.0.0-20220927174642-596836aea01f h1:gL5ijch0s90sLP9wKP5Zu1dudKIQZfG5KG5XolTHetg= github.com/scalr/go-scalr v0.0.0-20220927174642-596836aea01f/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= +github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205 h1:C8uAeyjZoc/lR5ZoLu1lVdDy5oOSHv+NGUYx1put0U8= +github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205/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= diff --git a/scalr/data_source_module_version.go b/scalr/data_source_module_version.go index 36e08730..0b4c29ca 100644 --- a/scalr/data_source_module_version.go +++ b/scalr/data_source_module_version.go @@ -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 { From 85d7c98a0cadf26de8528d957e27596ce655b647 Mon Sep 17 00:00:00 2001 From: Roman Mytsko Date: Wed, 5 Oct 2022 17:20:00 +0300 Subject: [PATCH 2/7] SCALRCORE-22522 update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09186732..9b2836cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,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 From 6e95381799a320d229d40dd70a25c1312bcc403e Mon Sep 17 00:00:00 2001 From: Roman Mytsko Date: Thu, 6 Oct 2022 15:34:50 +0300 Subject: [PATCH 3/7] SCALRCORE-22522 update go files [API_BRANCH] [DB_BRANCH] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index f4acf4b7..8677d600 100644 --- a/go.mod +++ b/go.mod @@ -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-20221006083506-ac5ad24eae0e + github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205 ) require ( diff --git a/go.sum b/go.sum index 2b4e97d4..780a67c3 100644 --- a/go.sum +++ b/go.sum @@ -308,6 +308,8 @@ github.com/scalr/go-scalr v0.0.0-20220929153017-904da00922e8 h1:vVRvHt15ADkb3615 github.com/scalr/go-scalr v0.0.0-20220929153017-904da00922e8/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/scalr/go-scalr v0.0.0-20221005083955-c4cad8bea4c4 h1:6DoYuQdAuwSBzOp3qSc8PWB25iXJjVcfbBg989xI8c8= github.com/scalr/go-scalr v0.0.0-20221005083955-c4cad8bea4c4/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= +github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205 h1:C8uAeyjZoc/lR5ZoLu1lVdDy5oOSHv+NGUYx1put0U8= +github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/scalr/go-scalr v0.0.0-20221006083506-ac5ad24eae0e h1:Td06x2URINLjDyTcvobS1MekaFI05A8nt/z+9A38FRQ= github.com/scalr/go-scalr v0.0.0-20221006083506-ac5ad24eae0e/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= From 144d0cb684cc5149a404336f582bdb27c1137127 Mon Sep 17 00:00:00 2001 From: Roman Mytsko Date: Thu, 6 Oct 2022 15:48:44 +0300 Subject: [PATCH 4/7] SCALRCORE-22522 update go files [API_BRANCH] [DB_BRANCH] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8677d600..fa934902 100644 --- a/go.mod +++ b/go.mod @@ -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-20221005134100-9bba27080205 + github.com/scalr/go-scalr v0.0.0-20221006124122-9373fba9ab89 ) require ( diff --git a/go.sum b/go.sum index 780a67c3..0acdcf97 100644 --- a/go.sum +++ b/go.sum @@ -312,6 +312,8 @@ github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205 h1:C8uAeyjZoc/lR5Zo github.com/scalr/go-scalr v0.0.0-20221005134100-9bba27080205/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/scalr/go-scalr v0.0.0-20221006083506-ac5ad24eae0e h1:Td06x2URINLjDyTcvobS1MekaFI05A8nt/z+9A38FRQ= github.com/scalr/go-scalr v0.0.0-20221006083506-ac5ad24eae0e/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= +github.com/scalr/go-scalr v0.0.0-20221006124122-9373fba9ab89 h1:ISHgVHVD98GGAN+lQJ1FI19Xzu5rstsL7j0t5t+l8vU= +github.com/scalr/go-scalr v0.0.0-20221006124122-9373fba9ab89/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= From a29a595d7c76816514f0c10738070d74569c05e0 Mon Sep 17 00:00:00 2001 From: Roman Mytsko Date: Thu, 6 Oct 2022 16:55:41 +0300 Subject: [PATCH 5/7] SCALRCORE-22522 fix typo [API_BRANCH] [DB_BRANCH] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ea2c4d2..743b4e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,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)) +- `module_verion`: data source: change relation from latest-module-version to module-version ([#181](https://github.com/Scalr/terraform-provider-scalr/pull/181)) ### Fixed From ffa2e6ffd38f7c02c726895b1d3fcb76bede02e3 Mon Sep 17 00:00:00 2001 From: Roman Mytsko Date: Tue, 18 Oct 2022 11:11:38 +0300 Subject: [PATCH 6/7] SCALRCORE-22522 update go files [API_BRANCH] [DB_BRANCH] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3f8ef49b..cdaa1679 100644 --- a/go.mod +++ b/go.mod @@ -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-20221018080206-684a28861661 ) require ( diff --git a/go.sum b/go.sum index e15171a6..40fc92b5 100644 --- a/go.sum +++ b/go.sum @@ -306,6 +306,8 @@ 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/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= From 4e72aecfed0b87ec9922356e1eeafec069fe2cca Mon Sep 17 00:00:00 2001 From: Roman Mytsko Date: Tue, 18 Oct 2022 14:23:40 +0300 Subject: [PATCH 7/7] SCALRCORE-22522 update go files [API_BRANCH] [DB_BRANCH] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index cdaa1679..26f3f9c1 100644 --- a/go.mod +++ b/go.mod @@ -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-20221018080206-684a28861661 + github.com/scalr/go-scalr v0.0.0-20221018111344-50c95bd1d8a5 ) require ( diff --git a/go.sum b/go.sum index 40fc92b5..eb0a76ab 100644 --- a/go.sum +++ b/go.sum @@ -308,6 +308,8 @@ github.com/scalr/go-scalr v0.0.0-20221017093222-a55f66132481 h1:2k89jDfme5jPSUxp 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=