Skip to content

Commit

Permalink
Change import log message
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrique Santos committed Sep 21, 2023
1 parent 6fba9fb commit 562d0e1
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion stackit/services/argus/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/argus/scrapeconfig/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/dns/recordset/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/dns/zone/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/logme/credentials/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/logme/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/mariadb/credentials/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/mariadb/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/opensearch/credentials/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/opensearch/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/postgresflex/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/postgresflex/user/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/postgresql/credentials/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/postgresql/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/rabbitmq/credentials/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/rabbitmq/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/redis/credentials/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/redis/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/resourcemanager/project/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/ske/cluster/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stackit/services/ske/project/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 562d0e1

Please sign in to comment.