From 5b82a881eec41419ff93f2e6ac1cca1bd796ba2b Mon Sep 17 00:00:00 2001 From: YannC Date: Wed, 5 Jun 2024 13:41:30 +0200 Subject: [PATCH] fix: cast description in utils role and fix tests --- internal/provider/resource_namespace_test.go | 4 ++++ internal/provider/utils_role.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_namespace_test.go b/internal/provider/resource_namespace_test.go index 9014be1..c3aa6dd 100644 --- a/internal/provider/resource_namespace_test.go +++ b/internal/provider/resource_namespace_test.go @@ -24,9 +24,11 @@ func TestAccResourceNamespace(t *testing.T) { ), concat( "- type: io.kestra.core.tasks.log.Log", + " forced: false", " values:", " message: first {{flow.id}}", "- type: io.kestra.core.tasks.debugs.Return", + " forced: false", " values:", " format: first {{flow.id}}", ), @@ -51,9 +53,11 @@ func TestAccResourceNamespace(t *testing.T) { ), concat( "- type: io.kestra.core.tasks.log.Log", + " forced: false", " values:", " message: first {{flow.id}}", "- type: io.kestra.core.tasks.debugs.Return", + " forced: false", " values:", " format: second {{flow.id}}", ), diff --git a/internal/provider/utils_role.go b/internal/provider/utils_role.go index 9bbf200..95efad8 100644 --- a/internal/provider/utils_role.go +++ b/internal/provider/utils_role.go @@ -48,7 +48,7 @@ func roleApiToSchema(r map[string]interface{}, d *schema.ResourceData, c *Client } } - if _, ok := r["description"]; ok { + if _, ok := r["description"].(string); ok { if err := d.Set("description", r["description"].(string)); err != nil { return diag.FromErr(err) }