From f42ede83c1aaf8ed1367484a1bab40c9715cb908 Mon Sep 17 00:00:00 2001 From: Vikas Maddukuri Date: Tue, 16 May 2023 14:24:33 +0530 Subject: [PATCH 1/2] fix: [PL-38540]: Fixed tests by fixing the name to lowercase --- .../service/platform/api_key/apiKey_test.go | 12 ++--- .../api_key/data_source_apiKey_test.go | 54 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/internal/service/platform/api_key/apiKey_test.go b/internal/service/platform/api_key/apiKey_test.go index 3e3fd6c60..36759db8f 100644 --- a/internal/service/platform/api_key/apiKey_test.go +++ b/internal/service/platform/api_key/apiKey_test.go @@ -22,7 +22,7 @@ func TestAccResourceApiKey(t *testing.T) { apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5)) updatedName := apiKeyName + "updated" - resourceName := "harness_platform_apiKey.test" + resourceName := "harness_platform_apikey.test" resource.UnitTest(t, resource.TestCase{ PreCheck: func() { acctest.TestAccPreCheck(t) }, @@ -57,7 +57,7 @@ func TestAccResourceApiKeyOrgLevel(t *testing.T) { apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5)) updatedName := apiKeyName + "updated" - resourceName := "harness_platform_apiKey.test" + resourceName := "harness_platform_apikey.test" resource.UnitTest(t, resource.TestCase{ PreCheck: func() { acctest.TestAccPreCheck(t) }, @@ -92,7 +92,7 @@ func TestAccResourceApiKeyProjectLevel(t *testing.T) { apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5)) updatedName := apiKeyName + "updated" - resourceName := "harness_platform_apiKey.test" + resourceName := "harness_platform_apikey.test" resource.UnitTest(t, resource.TestCase{ PreCheck: func() { acctest.TestAccPreCheck(t) }, @@ -141,7 +141,7 @@ func testAccGetResourceApiKey(resourceName string, state *terraform.State) (*nex func testAccResourceApiKey(id string, name string, parentId string, accountId string) string { return fmt.Sprintf(` - resource "harness_platform_apiKey" "test" { + resource "harness_platform_apikey" "test" { identifier = "%[1]s" name = "%[2]s" description="Test Description" @@ -160,7 +160,7 @@ func testOrgResourceApiKey(id string, name string, parentId string, accountId st name = "%[2]s" } - resource "harness_platform_apiKey" "test" { + resource "harness_platform_apikey" "test" { identifier = "%[1]s" name = "%[2]s" description="Test Description" @@ -187,7 +187,7 @@ func testProjectResourceApiKey(id string, name string, parentId string, accountI color = "#472848" } - resource "harness_platform_apiKey" "test" { + resource "harness_platform_apikey" "test" { identifier = "%[1]s" name = "%[2]s" description="Test Description" diff --git a/internal/service/platform/api_key/data_source_apiKey_test.go b/internal/service/platform/api_key/data_source_apiKey_test.go index 08e9aa90d..98de57c24 100644 --- a/internal/service/platform/api_key/data_source_apiKey_test.go +++ b/internal/service/platform/api_key/data_source_apiKey_test.go @@ -17,7 +17,7 @@ func TestAccDataSourceApiKey(t *testing.T) { apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5)) - resourceName := "data.harness_platform_apiKey.test" + resourceName := "data.harness_platform_apikey.test" resource.UnitTest(t, resource.TestCase{ PreCheck: func() { acctest.TestAccPreCheck(t) }, @@ -41,7 +41,7 @@ func TestAccDataSourceApiKeyOrgLevel(t *testing.T) { apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5)) - resourceName := "data.harness_platform_apiKey.test" + resourceName := "data.harness_platform_apikey.test" resource.UnitTest(t, resource.TestCase{ PreCheck: func() { acctest.TestAccPreCheck(t) }, @@ -66,7 +66,7 @@ func TestAccDataSourceApiKeyProjectLevel(t *testing.T) { apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5)) - resourceName := "data.harness_platform_apiKey.test" + resourceName := "data.harness_platform_apikey.test" resource.UnitTest(t, resource.TestCase{ PreCheck: func() { acctest.TestAccPreCheck(t) }, @@ -87,7 +87,7 @@ func TestAccDataSourceApiKeyProjectLevel(t *testing.T) { func testAccDataSourceApiKey(id string, name string, parentId string, accountId string) string { return fmt.Sprintf(` - resource "harness_platform_apiKey" "test" { + resource "harness_platform_apikey" "test" { identifier = "%[1]s" name = "%[2]s" description="Test Description" @@ -97,12 +97,12 @@ func testAccDataSourceApiKey(id string, name string, parentId string, accountId default_time_to_expire_token = 1000 } - data "harness_platform_apiKey" "test" { - identifier = harness_platform_apiKey.test.identifier - parent_id = harness_platform_apiKey.test.parent_id - apikey_type = harness_platform_apiKey.test.apikey_type - account_id = harness_platform_apiKey.test.account_id - name = harness_platform_apiKey.test.name + data "harness_platform_apikey" "test" { + identifier = harness_platform_apikey.test.identifier + parent_id = harness_platform_apikey.test.parent_id + apikey_type = harness_platform_apikey.test.apikey_type + account_id = harness_platform_apikey.test.account_id + name = harness_platform_apikey.test.name } `, id, name, parentId, accountId) } @@ -115,7 +115,7 @@ func testAccDataSourceApiKeyOrgLevel(id string, name string, parentId string, ac name = "%[2]s" } - resource "harness_platform_apiKey" "test" { + resource "harness_platform_apikey" "test" { identifier = "%[1]s" name = "%[2]s" description="Test Description" @@ -126,13 +126,13 @@ func testAccDataSourceApiKeyOrgLevel(id string, name string, parentId string, ac default_time_to_expire_token = 1000 } - data "harness_platform_apiKey" "test" { - identifier = harness_platform_apiKey.test.identifier - parent_id = harness_platform_apiKey.test.parent_id - apikey_type = harness_platform_apiKey.test.apikey_type - account_id = harness_platform_apiKey.test.account_id - org_id = harness_platform_apiKey.test.org_id - name = harness_platform_apiKey.test.name + data "harness_platform_apikey" "test" { + identifier = harness_platform_apikey.test.identifier + parent_id = harness_platform_apikey.test.parent_id + apikey_type = harness_platform_apikey.test.apikey_type + account_id = harness_platform_apikey.test.account_id + org_id = harness_platform_apikey.test.org_id + name = harness_platform_apikey.test.name } `, id, name, parentId, accountId) } @@ -151,7 +151,7 @@ func testAccDataSourceApiKeyProjectLevel(id string, name string, parentId string color = "#472848" } - resource "harness_platform_apiKey" "test" { + resource "harness_platform_apikey" "test" { identifier = "%[1]s" name = "%[2]s" description="Test Description" @@ -163,14 +163,14 @@ func testAccDataSourceApiKeyProjectLevel(id string, name string, parentId string default_time_to_expire_token = 1000 } - data "harness_platform_apiKey" "test" { - identifier = harness_platform_apiKey.test.identifier - parent_id = harness_platform_apiKey.test.parent_id - apikey_type = harness_platform_apiKey.test.apikey_type - account_id = harness_platform_apiKey.test.account_id - org_id = harness_platform_apiKey.test.org_id - project_id = harness_platform_apiKey.test.project_id - name = harness_platform_apiKey.test.name + data "harness_platform_apikey" "test" { + identifier = harness_platform_apikey.test.identifier + parent_id = harness_platform_apikey.test.parent_id + apikey_type = harness_platform_apikey.test.apikey_type + account_id = harness_platform_apikey.test.account_id + org_id = harness_platform_apikey.test.org_id + project_id = harness_platform_apikey.test.project_id + name = harness_platform_apikey.test.name } `, id, name, parentId, accountId) } From 2a08351bda2a7e1179b867af12524f2d8e726aaa Mon Sep 17 00:00:00 2001 From: Harness CI Date: Tue, 16 May 2023 09:53:56 +0000 Subject: [PATCH 2/2] Update Changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c63dd5680..c814e12c7 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 0.20.0 (May 16,2023) + +FEATURES: + +* **New Resource:** `resource/harness_platform_apikey: Added ApiKey resource.` ([#532](https://github.com/harness/terraform-provider-harness/issues/532)) + +ENHANCEMENTS: + +* resources/platform_role_assignments: Made resource_group_identifier, role_identifier and type under principal schema required. +resources/platform_secret_sshkey: Updated the Behaviour of referencing the secrets at account, project and org Level. Made Key Field Required in SSH credential of type keyReference ([#509](https://github.com/harness/terraform-provider-harness/issues/509)) + # 0.19.2 (May 11,2023) FEATURES: