From b736f4bafdccb465482451a9f05b6d3abb4eb97c Mon Sep 17 00:00:00 2001 From: Christian Lechner Date: Tue, 25 Jul 2023 14:47:46 +0200 Subject: [PATCH 1/2] docu: align error message punctuation to Terraform best practices --- internal/provider/datasource_whoami.go | 2 +- .../provider/resource_directory_role_collection_assignment.go | 2 +- .../resource_globalaccount_role_collection_assignment.go | 2 +- .../provider/resource_subaccount_role_collection_assignment.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/provider/datasource_whoami.go b/internal/provider/datasource_whoami.go index a092363a..77dbc502 100644 --- a/internal/provider/datasource_whoami.go +++ b/internal/provider/datasource_whoami.go @@ -69,7 +69,7 @@ func (gen *whoamiDataSource) Read(ctx context.Context, req datasource.ReadReques user := gen.client.GetLoggedInUser() if user == nil { - resp.Diagnostics.AddError("No user found", "") + resp.Diagnostics.AddError("No User Found", "") return } diff --git a/internal/provider/resource_directory_role_collection_assignment.go b/internal/provider/resource_directory_role_collection_assignment.go index 1c1c8596..60da00ae 100644 --- a/internal/provider/resource_directory_role_collection_assignment.go +++ b/internal/provider/resource_directory_role_collection_assignment.go @@ -199,7 +199,7 @@ func (rs *directoryRoleCollectionAssignmentResource) Delete(ctx context.Context, func (rs *directoryRoleCollectionAssignmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resp.Diagnostics.AddError( - "Import not supported", + "Import Not Supported", "Import is not supported for this resource. Use the resource directory_role_collection instead.", ) } diff --git a/internal/provider/resource_globalaccount_role_collection_assignment.go b/internal/provider/resource_globalaccount_role_collection_assignment.go index 3ada2352..4b2e7a78 100644 --- a/internal/provider/resource_globalaccount_role_collection_assignment.go +++ b/internal/provider/resource_globalaccount_role_collection_assignment.go @@ -188,7 +188,7 @@ func (rs *globalaccountRoleCollectionAssignmentResource) Delete(ctx context.Cont func (rs *globalaccountRoleCollectionAssignmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resp.Diagnostics.AddError( - "Import not supported", + "Import Not Supported", "Import is not supported for this resource. Use the resource globalaccount_role_collection instead.", ) } diff --git a/internal/provider/resource_subaccount_role_collection_assignment.go b/internal/provider/resource_subaccount_role_collection_assignment.go index 082b23b1..c235f7b8 100644 --- a/internal/provider/resource_subaccount_role_collection_assignment.go +++ b/internal/provider/resource_subaccount_role_collection_assignment.go @@ -200,7 +200,7 @@ func (rs *subaccountRoleCollectionAssignmentResource) Delete(ctx context.Context func (rs *subaccountRoleCollectionAssignmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resp.Diagnostics.AddError( - "Import not supported", + "Import Not Supported", "Import is not supported for this resource. Use the resource subaccount_role_collection instead.", ) } From 788892a91c8872a1bd09bdd9d1f5e499608257d0 Mon Sep 17 00:00:00 2001 From: Christian Lechner Date: Tue, 25 Jul 2023 15:06:46 +0200 Subject: [PATCH 2/2] fix: adjustement of test cases for changed import not supported message --- .../resource_directory_role_collection_assignment_test.go | 2 +- .../resource_globalaccount_role_collection_assignment_test.go | 2 +- .../resource_subaccount_role_collection_assignment_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/provider/resource_directory_role_collection_assignment_test.go b/internal/provider/resource_directory_role_collection_assignment_test.go index f6386c22..b43225e1 100644 --- a/internal/provider/resource_directory_role_collection_assignment_test.go +++ b/internal/provider/resource_directory_role_collection_assignment_test.go @@ -68,7 +68,7 @@ func TestResourceDirectoryRoleCollectionAssignment(t *testing.T) { ImportStateId: "05368777-4934-41e8-9f3c-6ec5f4d564b9", ImportState: true, ImportStateVerify: true, - ExpectError: regexp.MustCompile(`Import not supported`), + ExpectError: regexp.MustCompile(`Import Not Supported`), }, }, }) diff --git a/internal/provider/resource_globalaccount_role_collection_assignment_test.go b/internal/provider/resource_globalaccount_role_collection_assignment_test.go index ca5ae45e..7e311c42 100644 --- a/internal/provider/resource_globalaccount_role_collection_assignment_test.go +++ b/internal/provider/resource_globalaccount_role_collection_assignment_test.go @@ -66,7 +66,7 @@ func TestResourceGlobalaccountRoleCollectionAssignment(t *testing.T) { ImportStateId: "anyID", ImportState: true, ImportStateVerify: true, - ExpectError: regexp.MustCompile(`Import not supported`), + ExpectError: regexp.MustCompile(`Import Not Supported`), }, }, }) diff --git a/internal/provider/resource_subaccount_role_collection_assignment_test.go b/internal/provider/resource_subaccount_role_collection_assignment_test.go index 5c88ade3..b9240d7b 100644 --- a/internal/provider/resource_subaccount_role_collection_assignment_test.go +++ b/internal/provider/resource_subaccount_role_collection_assignment_test.go @@ -68,7 +68,7 @@ func TestResourceRolCollectionAssignment(t *testing.T) { ImportStateId: "ef23ace8-6ade-4d78-9c1f-8df729548bbf", ImportState: true, ImportStateVerify: true, - ExpectError: regexp.MustCompile(`Import not supported`), + ExpectError: regexp.MustCompile(`Import Not Supported`), }, }, })