diff --git a/civo/instances/resource_instance.go b/civo/instances/resource_instance.go index 42610a25..8e0ea1a2 100644 --- a/civo/instances/resource_instance.go +++ b/civo/instances/resource_instance.go @@ -5,11 +5,12 @@ import ( "encoding/base64" "errors" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/civo/civogo" "github.com/civo/terraform-provider-civo/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -285,7 +286,8 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, m inter if parseErr == nil { err = customErr } - return diag.Errorf("[ERR] failed to create instance: %s", err) + // quota errors introduce new line after each missing quota, causing formatting issues: + return diag.Errorf("[ERR] failed to create instance: %s", strings.ReplaceAll(err.Error(), "\n", " ")) } d.SetId(instance.ID) diff --git a/civo/kubernetes/resource_kubernetes_cluster.go b/civo/kubernetes/resource_kubernetes_cluster.go index 003a2e63..81a1f5b7 100644 --- a/civo/kubernetes/resource_kubernetes_cluster.go +++ b/civo/kubernetes/resource_kubernetes_cluster.go @@ -287,7 +287,8 @@ func resourceKubernetesClusterCreate(ctx context.Context, d *schema.ResourceData log.Printf("[INFO] kubernertes config %+v", config) resp, err := apiClient.NewKubernetesClusters(config) if err != nil { - return diag.Errorf("[ERR] failed to create the kubernetes cluster: %s", err) + // quota errors introduce new line after each missing quota, causing formatting issues: + return diag.Errorf("[ERR] failed to create the kubernetes cluster: %s", strings.ReplaceAll(err.Error(), "\n", " ")) } d.SetId(resp.ID)