From 562d0e12a58443c40d4ac4f60169cb093f6b7987 Mon Sep 17 00:00:00 2001 From: Henrique Santos Date: Thu, 21 Sep 2023 08:56:16 +0100 Subject: [PATCH] Change import log message --- stackit/services/argus/instance/resource.go | 2 +- stackit/services/argus/scrapeconfig/resource.go | 2 +- stackit/services/dns/recordset/resource.go | 2 +- stackit/services/dns/zone/resource.go | 2 +- stackit/services/logme/credentials/resource.go | 2 +- stackit/services/logme/instance/resource.go | 2 +- stackit/services/mariadb/credentials/resource.go | 2 +- stackit/services/mariadb/instance/resource.go | 2 +- stackit/services/opensearch/credentials/resource.go | 2 +- stackit/services/opensearch/instance/resource.go | 2 +- stackit/services/postgresflex/instance/resource.go | 2 +- stackit/services/postgresflex/user/resource.go | 2 +- stackit/services/postgresql/credentials/resource.go | 2 +- stackit/services/postgresql/instance/resource.go | 2 +- stackit/services/rabbitmq/credentials/resource.go | 2 +- stackit/services/rabbitmq/instance/resource.go | 2 +- stackit/services/redis/credentials/resource.go | 2 +- stackit/services/redis/instance/resource.go | 2 +- stackit/services/resourcemanager/project/resource.go | 2 +- stackit/services/ske/cluster/resource.go | 2 +- stackit/services/ske/project/resource.go | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/stackit/services/argus/instance/resource.go b/stackit/services/argus/instance/resource.go index a38c5454..dff94f44 100644 --- a/stackit/services/argus/instance/resource.go +++ b/stackit/services/argus/instance/resource.go @@ -435,7 +435,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/argus/scrapeconfig/resource.go b/stackit/services/argus/scrapeconfig/resource.go index 3caa06c7..10adb7e7 100644 --- a/stackit/services/argus/scrapeconfig/resource.go +++ b/stackit/services/argus/scrapeconfig/resource.go @@ -425,7 +425,7 @@ func (r *scrapeConfigResource) ImportState(ctx context.Context, req resource.Imp if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing scrape config", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id],[name] Got: %q", req.ID), ) return diff --git a/stackit/services/dns/recordset/resource.go b/stackit/services/dns/recordset/resource.go index 6e45277a..36a4a7f3 100644 --- a/stackit/services/dns/recordset/resource.go +++ b/stackit/services/dns/recordset/resource.go @@ -394,7 +394,7 @@ func (r *recordSetResource) ImportState(ctx context.Context, req resource.Import idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing record set", fmt.Sprintf("Expected import identifier with format [project_id],[zone_id],[record_set_id], got %q", req.ID), ) return diff --git a/stackit/services/dns/zone/resource.go b/stackit/services/dns/zone/resource.go index 0458946e..e7740bd7 100644 --- a/stackit/services/dns/zone/resource.go +++ b/stackit/services/dns/zone/resource.go @@ -474,7 +474,7 @@ func (r *zoneResource) ImportState(ctx context.Context, req resource.ImportState if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing zone", fmt.Sprintf("Expected import identifier with format: [project_id],[zone_id] Got: %q", req.ID), ) return diff --git a/stackit/services/logme/credentials/resource.go b/stackit/services/logme/credentials/resource.go index f0a1b6f0..f1e32f15 100644 --- a/stackit/services/logme/credentials/resource.go +++ b/stackit/services/logme/credentials/resource.go @@ -310,7 +310,7 @@ func (r *credentialsResource) ImportState(ctx context.Context, req resource.Impo idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing credentials", fmt.Sprintf("Expected import identifier with format [project_id],[instance_id],[credentials_id], got %q", req.ID), ) return diff --git a/stackit/services/logme/instance/resource.go b/stackit/services/logme/instance/resource.go index c6dc2a95..b39ef8ea 100644 --- a/stackit/services/logme/instance/resource.go +++ b/stackit/services/logme/instance/resource.go @@ -445,7 +445,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/mariadb/credentials/resource.go b/stackit/services/mariadb/credentials/resource.go index b539b5cc..54557b58 100644 --- a/stackit/services/mariadb/credentials/resource.go +++ b/stackit/services/mariadb/credentials/resource.go @@ -310,7 +310,7 @@ func (r *credentialsResource) ImportState(ctx context.Context, req resource.Impo idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing credentials", fmt.Sprintf("Expected import identifier with format [project_id],[instance_id],[credentials_id], got %q", req.ID), ) return diff --git a/stackit/services/mariadb/instance/resource.go b/stackit/services/mariadb/instance/resource.go index bfe116cd..7e0e6134 100644 --- a/stackit/services/mariadb/instance/resource.go +++ b/stackit/services/mariadb/instance/resource.go @@ -445,7 +445,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/opensearch/credentials/resource.go b/stackit/services/opensearch/credentials/resource.go index 12bd5f05..d12862ac 100644 --- a/stackit/services/opensearch/credentials/resource.go +++ b/stackit/services/opensearch/credentials/resource.go @@ -310,7 +310,7 @@ func (r *credentialsResource) ImportState(ctx context.Context, req resource.Impo idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing credentials", fmt.Sprintf("Expected import identifier with format [project_id],[instance_id],[credentials_id], got %q", req.ID), ) return diff --git a/stackit/services/opensearch/instance/resource.go b/stackit/services/opensearch/instance/resource.go index 188aa1d7..938efed2 100644 --- a/stackit/services/opensearch/instance/resource.go +++ b/stackit/services/opensearch/instance/resource.go @@ -445,7 +445,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/postgresflex/instance/resource.go b/stackit/services/postgresflex/instance/resource.go index 443f8e7f..2a9b1960 100644 --- a/stackit/services/postgresflex/instance/resource.go +++ b/stackit/services/postgresflex/instance/resource.go @@ -480,7 +480,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/postgresflex/user/resource.go b/stackit/services/postgresflex/user/resource.go index cdc39584..a42d799c 100644 --- a/stackit/services/postgresflex/user/resource.go +++ b/stackit/services/postgresflex/user/resource.go @@ -317,7 +317,7 @@ func (r *userResource) ImportState(ctx context.Context, req resource.ImportState idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing user", fmt.Sprintf("Expected import identifier with format [project_id],[instance_id],[user_id], got %q", req.ID), ) return diff --git a/stackit/services/postgresql/credentials/resource.go b/stackit/services/postgresql/credentials/resource.go index 5551cecc..76a55e23 100644 --- a/stackit/services/postgresql/credentials/resource.go +++ b/stackit/services/postgresql/credentials/resource.go @@ -310,7 +310,7 @@ func (r *credentialsResource) ImportState(ctx context.Context, req resource.Impo idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing credentials", fmt.Sprintf("Expected import identifier with format [project_id],[instance_id],[credentials_id], got %q", req.ID), ) return diff --git a/stackit/services/postgresql/instance/resource.go b/stackit/services/postgresql/instance/resource.go index 3c6ea955..0739c85c 100644 --- a/stackit/services/postgresql/instance/resource.go +++ b/stackit/services/postgresql/instance/resource.go @@ -545,7 +545,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/rabbitmq/credentials/resource.go b/stackit/services/rabbitmq/credentials/resource.go index bb835ebb..8d45ea7d 100644 --- a/stackit/services/rabbitmq/credentials/resource.go +++ b/stackit/services/rabbitmq/credentials/resource.go @@ -310,7 +310,7 @@ func (r *credentialsResource) ImportState(ctx context.Context, req resource.Impo idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing credentials", fmt.Sprintf("Expected import identifier with format [project_id],[instance_id],[credentials_id], got %q", req.ID), ) return diff --git a/stackit/services/rabbitmq/instance/resource.go b/stackit/services/rabbitmq/instance/resource.go index 57904706..f005e822 100644 --- a/stackit/services/rabbitmq/instance/resource.go +++ b/stackit/services/rabbitmq/instance/resource.go @@ -445,7 +445,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/redis/credentials/resource.go b/stackit/services/redis/credentials/resource.go index cf5cf91f..c8b98694 100644 --- a/stackit/services/redis/credentials/resource.go +++ b/stackit/services/redis/credentials/resource.go @@ -310,7 +310,7 @@ func (r *redisCredentialsResource) ImportState(ctx context.Context, req resource idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing credentials", fmt.Sprintf("Expected import identifier with format [project_id],[instance_id],[credentials_id], got %q", req.ID), ) return diff --git a/stackit/services/redis/instance/resource.go b/stackit/services/redis/instance/resource.go index d7292bac..b6b996e3 100644 --- a/stackit/services/redis/instance/resource.go +++ b/stackit/services/redis/instance/resource.go @@ -445,7 +445,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing instance", fmt.Sprintf("Expected import identifier with format: [project_id],[instance_id] Got: %q", req.ID), ) return diff --git a/stackit/services/resourcemanager/project/resource.go b/stackit/services/resourcemanager/project/resource.go index 45d2106c..ccd9241b 100644 --- a/stackit/services/resourcemanager/project/resource.go +++ b/stackit/services/resourcemanager/project/resource.go @@ -343,7 +343,7 @@ func (r *projectResource) ImportState(ctx context.Context, req resource.ImportSt idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 1 || idParts[0] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing project", fmt.Sprintf("Expected import identifier with format: [container_id] Got: %q", req.ID), ) return diff --git a/stackit/services/ske/cluster/resource.go b/stackit/services/ske/cluster/resource.go index 3df3c685..3b059d24 100644 --- a/stackit/services/ske/cluster/resource.go +++ b/stackit/services/ske/cluster/resource.go @@ -1159,7 +1159,7 @@ func (r *clusterResource) ImportState(ctx context.Context, req resource.ImportSt if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing cluster", fmt.Sprintf("Expected import identifier with format: [project_id],[name] Got: %q", req.ID), ) return diff --git a/stackit/services/ske/project/resource.go b/stackit/services/ske/project/resource.go index f410cb58..fc4400aa 100644 --- a/stackit/services/ske/project/resource.go +++ b/stackit/services/ske/project/resource.go @@ -202,7 +202,7 @@ func (r *projectResource) ImportState(ctx context.Context, req resource.ImportSt idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 1 || idParts[0] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, - "Unexpected import identifier", + "Error importing project", fmt.Sprintf("Expected import identifier with format: [project_id] Got: %q", req.ID), ) return