From 6811c6a3c0726964408d1a86f47a634694a0c46d Mon Sep 17 00:00:00 2001 From: ilya-hontarau Date: Thu, 16 May 2024 15:51:13 +0200 Subject: [PATCH 1/3] Update module id --- spacelift/data_aws_integration_attachment_test.go | 2 +- spacelift/data_aws_role_test.go | 4 ++-- spacelift/data_azure_integration_attachment_test.go | 2 +- spacelift/data_context_attachment_test.go | 2 +- spacelift/data_environment_variable_test.go | 2 +- spacelift/data_gcp_service_account_test.go | 2 +- spacelift/data_module_test.go | 2 +- spacelift/data_mounted_file_test.go | 2 +- spacelift/data_stack_test.go | 2 +- spacelift/data_webhook_test.go | 2 +- spacelift/resource_aws_role_test.go | 4 ++-- spacelift/resource_context_attachment_test.go | 2 +- spacelift/resource_environment_variable_test.go | 2 +- spacelift/resource_gcp_service_account_test.go | 2 +- spacelift/resource_module_test.go | 4 ++-- spacelift/resource_mounted_file_test.go | 2 +- spacelift/resource_policy_attachment_test.go | 2 +- spacelift/resource_stack_test.go | 2 +- spacelift/resource_webhook_test.go | 2 +- 19 files changed, 22 insertions(+), 22 deletions(-) diff --git a/spacelift/data_aws_integration_attachment_test.go b/spacelift/data_aws_integration_attachment_test.go index 0c6b8e2b..4449e810 100644 --- a/spacelift/data_aws_integration_attachment_test.go +++ b/spacelift/data_aws_integration_attachment_test.go @@ -86,7 +86,7 @@ func TestAWSIntegrationAttachmentData(t *testing.T) { Check: Resource( resourceName, Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), AttributeNotPresent("stack_id"), ), }}) diff --git a/spacelift/data_aws_role_test.go b/spacelift/data_aws_role_test.go index a99334f4..d7d2a94e 100644 --- a/spacelift/data_aws_role_test.go +++ b/spacelift/data_aws_role_test.go @@ -69,7 +69,7 @@ func TestAWSRoleData(t *testing.T) { Check: Resource( "data.spacelift_aws_role.test", Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("role_arn", Equals("arn:aws:iam::039653571618:role/empty-test-role")), Attribute("generate_credentials_in_worker", Equals("false")), Attribute("duration_seconds", Equals("931")), @@ -138,7 +138,7 @@ func TestAWSRoleData(t *testing.T) { Check: Resource( "data.spacelift_aws_role.test", Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("role_arn", Equals("custom_role_arn")), Attribute("generate_credentials_in_worker", Equals("true")), Attribute("external_id", Equals("external@id")), diff --git a/spacelift/data_azure_integration_attachment_test.go b/spacelift/data_azure_integration_attachment_test.go index 398e110d..d1c1782b 100644 --- a/spacelift/data_azure_integration_attachment_test.go +++ b/spacelift/data_azure_integration_attachment_test.go @@ -85,7 +85,7 @@ func TestAzureIntegrationAttachmentData(t *testing.T) { Check: Resource( resourceName, Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), AttributeNotPresent("stack_id"), ), }}) diff --git a/spacelift/data_context_attachment_test.go b/spacelift/data_context_attachment_test.go index c6fa2e4d..c058bda8 100644 --- a/spacelift/data_context_attachment_test.go +++ b/spacelift/data_context_attachment_test.go @@ -77,7 +77,7 @@ func TestContextAttachmentData(t *testing.T) { Check: Resource( "data.spacelift_context_attachment.test", Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("priority", Equals("1")), AttributeNotPresent("stack_id"), ), diff --git a/spacelift/data_environment_variable_test.go b/spacelift/data_environment_variable_test.go index ed8e501d..bdf6ef6c 100644 --- a/spacelift/data_environment_variable_test.go +++ b/spacelift/data_environment_variable_test.go @@ -70,7 +70,7 @@ func TestEnvironmentVariableData(t *testing.T) { `, randomID), Check: Resource( "data.spacelift_environment_variable.test", - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("value", Equals("is tasty")), Attribute("write_only", Equals("false")), AttributeNotPresent("context_id"), diff --git a/spacelift/data_gcp_service_account_test.go b/spacelift/data_gcp_service_account_test.go index 6649c196..e4495115 100644 --- a/spacelift/data_gcp_service_account_test.go +++ b/spacelift/data_gcp_service_account_test.go @@ -64,7 +64,7 @@ func TestGCPServiceAccountData(t *testing.T) { Check: Resource( "data.spacelift_gcp_service_account.test", Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-defautl-test-module-%s", randomID))), Attribute("service_account_email", IsNotEmpty()), SetEquals("token_scopes", "https://www.googleapis.com/auth/compute"), AttributeNotPresent("stack_id"), diff --git a/spacelift/data_module_test.go b/spacelift/data_module_test.go index 58b8aa30..205b8ade 100644 --- a/spacelift/data_module_test.go +++ b/spacelift/data_module_test.go @@ -117,7 +117,7 @@ func TestModuleDataSpace(t *testing.T) { `, randomID), Check: Resource( "data.spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("description")), diff --git a/spacelift/data_mounted_file_test.go b/spacelift/data_mounted_file_test.go index f44d98aa..25f53500 100644 --- a/spacelift/data_mounted_file_test.go +++ b/spacelift/data_mounted_file_test.go @@ -69,7 +69,7 @@ func TestMountedFileData(t *testing.T) { `, randomID), Check: Resource( "data.spacelift_mounted_file.test", - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("content", Equals("YmFjb24gaXMgdGFzdHk=")), Attribute("write_only", Equals("false")), AttributeNotPresent("context_id"), diff --git a/spacelift/data_stack_test.go b/spacelift/data_stack_test.go index 2720b73a..844e3a12 100644 --- a/spacelift/data_stack_test.go +++ b/spacelift/data_stack_test.go @@ -187,7 +187,7 @@ func TestStackData(t *testing.T) { `, randomID), Check: Resource( "data.spacelift_stack.test", - Attribute("kubernetes.0.kubectl_version", Equals("1.23.5")), + Attribute("kubernetes.0.kubectl_version", IsNotEmpty()), ), }}) }) diff --git a/spacelift/data_webhook_test.go b/spacelift/data_webhook_test.go index dc37b996..28317584 100644 --- a/spacelift/data_webhook_test.go +++ b/spacelift/data_webhook_test.go @@ -73,7 +73,7 @@ func TestWebhookData(t *testing.T) { Attribute("endpoint", Equals("https://bacon.org")), Attribute("enabled", Equals("true")), Attribute("secret", Equals("very-very-secret")), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), AttributeNotPresent("stack_id"), ), }}) diff --git a/spacelift/resource_aws_role_test.go b/spacelift/resource_aws_role_test.go index 1592081a..e749fb14 100644 --- a/spacelift/resource_aws_role_test.go +++ b/spacelift/resource_aws_role_test.go @@ -84,7 +84,7 @@ func TestAWSRoleResource(t *testing.T) { Check: Resource( resourceName, Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("generate_credentials_in_worker", Equals("false")), Attribute("duration_seconds", Equals("942")), Attribute("external_id", IsEmpty()), @@ -150,7 +150,7 @@ func TestAWSRoleResource(t *testing.T) { Check: Resource( "spacelift_aws_role.test", Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("generate_credentials_in_worker", Equals("true")), Attribute("external_id", IsEmpty()), AttributeNotPresent("stack_id"), diff --git a/spacelift/resource_context_attachment_test.go b/spacelift/resource_context_attachment_test.go index 53d15bdc..2a1a9027 100644 --- a/spacelift/resource_context_attachment_test.go +++ b/spacelift/resource_context_attachment_test.go @@ -91,7 +91,7 @@ func TestContextAttachmentResource(t *testing.T) { Check: Resource( "spacelift_context_attachment.test", Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), AttributeNotPresent("stack_id"), ), }, diff --git a/spacelift/resource_environment_variable_test.go b/spacelift/resource_environment_variable_test.go index e67ffe8f..a69b1dfb 100644 --- a/spacelift/resource_environment_variable_test.go +++ b/spacelift/resource_environment_variable_test.go @@ -84,7 +84,7 @@ func TestEnvironmentVariableResource(t *testing.T) { `, randomID), Check: Resource( resourceName, - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("value", Equals("4d5d01ea427b10dd483e8fce5b5149fb5a9814e9ee614176b756ca4a65c8f154")), Attribute("write_only", Equals("true")), AttributeNotPresent("context_id"), diff --git a/spacelift/resource_gcp_service_account_test.go b/spacelift/resource_gcp_service_account_test.go index 29343aad..b477449d 100644 --- a/spacelift/resource_gcp_service_account_test.go +++ b/spacelift/resource_gcp_service_account_test.go @@ -77,7 +77,7 @@ func TestGCPServiceAccountResource(t *testing.T) { Check: Resource( resourceName, Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), ), }, { diff --git a/spacelift/resource_module_test.go b/spacelift/resource_module_test.go index dc2cefc8..dd0d8191 100644 --- a/spacelift/resource_module_test.go +++ b/spacelift/resource_module_test.go @@ -38,7 +38,7 @@ func TestModuleResource(t *testing.T) { Config: config("old description", true, false), Check: Resource( "spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("github-module-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-default-github-module-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("old description")), @@ -286,7 +286,7 @@ func TestModuleResourceSpace(t *testing.T) { Config: config("old description", true), Check: Resource( "spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("github-module-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-default-github-module-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("old description")), diff --git a/spacelift/resource_mounted_file_test.go b/spacelift/resource_mounted_file_test.go index 89cf3a3f..3bdf0e32 100644 --- a/spacelift/resource_mounted_file_test.go +++ b/spacelift/resource_mounted_file_test.go @@ -75,7 +75,7 @@ func TestMountedFileResource(t *testing.T) { `, randomID), Check: Resource( resourceName, - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("write_only", Equals("true")), ), }, diff --git a/spacelift/resource_policy_attachment_test.go b/spacelift/resource_policy_attachment_test.go index bccff131..b482ce91 100644 --- a/spacelift/resource_policy_attachment_test.go +++ b/spacelift/resource_policy_attachment_test.go @@ -81,7 +81,7 @@ func TestPolicyAttachmentResource(t *testing.T) { resourceName, Attribute("id", IsNotEmpty()), Attribute("policy_id", Contains(randomID)), - Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), ), }, { diff --git a/spacelift/resource_stack_test.go b/spacelift/resource_stack_test.go index 9ccc9dad..6cb39e2d 100644 --- a/spacelift/resource_stack_test.go +++ b/spacelift/resource_stack_test.go @@ -503,7 +503,7 @@ func TestStackResource(t *testing.T) { resourceName, Attribute("id", StartsWith("provider-test-stack")), Attribute("kubernetes.0.namespace", Equals("myapp-prod")), - Attribute("kubernetes.0.kubectl_version", Equals("1.23.5")), + Attribute("kubernetes.0.kubectl_version", IsNotEmpty()), Attribute("ansible.#", Equals("0")), Attribute("pulumi.#", Equals("0")), Attribute("cloudformation.#", Equals("0")), diff --git a/spacelift/resource_webhook_test.go b/spacelift/resource_webhook_test.go index c9c54211..51178958 100644 --- a/spacelift/resource_webhook_test.go +++ b/spacelift/resource_webhook_test.go @@ -83,7 +83,7 @@ func TestWebhookResource(t *testing.T) { { ResourceName: resourceName, ImportState: true, - ImportStateIdPrefix: fmt.Sprintf("module/test-module-%s/", randomID), + ImportStateIdPrefix: fmt.Sprintf("module/terraform-default-test-module-%s/", randomID), ImportStateVerify: true, }, }) From af685c5963d16c9ad17c3748815d5d4665ffd406 Mon Sep 17 00:00:00 2001 From: ilya-hontarau Date: Thu, 16 May 2024 16:19:45 +0200 Subject: [PATCH 2/3] Update import module state id --- spacelift/data_module_test.go | 2 +- spacelift/resource_aws_role_test.go | 2 +- spacelift/resource_gcp_service_account_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spacelift/data_module_test.go b/spacelift/data_module_test.go index 205b8ade..3f4f5db4 100644 --- a/spacelift/data_module_test.go +++ b/spacelift/data_module_test.go @@ -31,7 +31,7 @@ func TestModuleData(t *testing.T) { `, randomID), Check: Resource( "data.spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("test-module-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("description")), diff --git a/spacelift/resource_aws_role_test.go b/spacelift/resource_aws_role_test.go index e749fb14..d8e49436 100644 --- a/spacelift/resource_aws_role_test.go +++ b/spacelift/resource_aws_role_test.go @@ -94,7 +94,7 @@ func TestAWSRoleResource(t *testing.T) { { ResourceName: resourceName, ImportState: true, - ImportStateId: fmt.Sprintf("module/test-module-%s", randomID), + ImportStateId: fmt.Sprintf("module/terraform-default-test-module-%s", randomID), ImportStateVerify: true, }, }) diff --git a/spacelift/resource_gcp_service_account_test.go b/spacelift/resource_gcp_service_account_test.go index b477449d..a3c80054 100644 --- a/spacelift/resource_gcp_service_account_test.go +++ b/spacelift/resource_gcp_service_account_test.go @@ -83,7 +83,7 @@ func TestGCPServiceAccountResource(t *testing.T) { { ResourceName: resourceName, ImportState: true, - ImportStateId: fmt.Sprintf("module/test-module-%s", randomID), + ImportStateId: fmt.Sprintf("module/terraform-default-test-module-%s", randomID), ImportStateVerify: true, }, }) From d678f00320f533260c70f8daeb000606cd0b7045 Mon Sep 17 00:00:00 2001 From: ilya-hontarau Date: Thu, 16 May 2024 16:54:50 +0200 Subject: [PATCH 3/3] Fix missing import id --- spacelift/data_gcp_service_account_test.go | 2 +- spacelift/resource_context_attachment_test.go | 2 +- spacelift/resource_module_test.go | 4 ++-- spacelift/resource_policy_attachment_test.go | 2 +- spacelift/resource_stack_test.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spacelift/data_gcp_service_account_test.go b/spacelift/data_gcp_service_account_test.go index e4495115..d4a81d1e 100644 --- a/spacelift/data_gcp_service_account_test.go +++ b/spacelift/data_gcp_service_account_test.go @@ -64,7 +64,7 @@ func TestGCPServiceAccountData(t *testing.T) { Check: Resource( "data.spacelift_gcp_service_account.test", Attribute("id", IsNotEmpty()), - Attribute("module_id", Equals(fmt.Sprintf("terraform-defautl-test-module-%s", randomID))), + Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))), Attribute("service_account_email", IsNotEmpty()), SetEquals("token_scopes", "https://www.googleapis.com/auth/compute"), AttributeNotPresent("stack_id"), diff --git a/spacelift/resource_context_attachment_test.go b/spacelift/resource_context_attachment_test.go index 2a1a9027..eb2c9f6d 100644 --- a/spacelift/resource_context_attachment_test.go +++ b/spacelift/resource_context_attachment_test.go @@ -98,7 +98,7 @@ func TestContextAttachmentResource(t *testing.T) { { ResourceName: resourceName, ImportState: true, - ImportStateId: fmt.Sprintf("test-context-%s/test-module-%s", randomID, randomID), + ImportStateId: fmt.Sprintf("test-context-%s/terraform-default-test-module-%s", randomID, randomID), ImportStateVerify: true, }}) }) diff --git a/spacelift/resource_module_test.go b/spacelift/resource_module_test.go index dd0d8191..2d094fd2 100644 --- a/spacelift/resource_module_test.go +++ b/spacelift/resource_module_test.go @@ -95,7 +95,7 @@ func TestModuleResource(t *testing.T) { Config: config("test-root/ab"), Check: Resource( "spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("project-root-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-papaya-project-root-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("description")), @@ -342,7 +342,7 @@ func TestModuleResourceSpace(t *testing.T) { Config: config("test-root/ab"), Check: Resource( "spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("project-root-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-papaya-project-root-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("description")), diff --git a/spacelift/resource_policy_attachment_test.go b/spacelift/resource_policy_attachment_test.go index b482ce91..836c0d77 100644 --- a/spacelift/resource_policy_attachment_test.go +++ b/spacelift/resource_policy_attachment_test.go @@ -87,7 +87,7 @@ func TestPolicyAttachmentResource(t *testing.T) { { ResourceName: resourceName, ImportState: true, - ImportStateId: fmt.Sprintf("my-first-policy-%s/test-module-%s", randomID, randomID), + ImportStateId: fmt.Sprintf("my-first-policy-%s/terraform-default-test-module-%s", randomID, randomID), ImportStateVerify: true, }, }) diff --git a/spacelift/resource_stack_test.go b/spacelift/resource_stack_test.go index 6cb39e2d..f8550465 100644 --- a/spacelift/resource_stack_test.go +++ b/spacelift/resource_stack_test.go @@ -488,7 +488,7 @@ func TestStackResource(t *testing.T) { resourceName, Attribute("id", StartsWith("provider-test-stack")), Attribute("kubernetes.0.namespace", Equals("")), - Attribute("kubernetes.0.kubectl_version", Equals("1.23.5")), + Attribute("kubernetes.0.kubectl_version", IsNotEmpty()), Attribute("ansible.#", Equals("0")), Attribute("pulumi.#", Equals("0")), Attribute("cloudformation.#", Equals("0")),