diff --git a/go.mod b/go.mod index 43e310ae1..05c034473 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,10 @@ require ( golang.org/x/mod v0.28.0 ) +replace ( + github.com/stackitcloud/stackit-sdk-go/services/ske => /Users/uphoffm/GolandProjects/stackit-sdk-go/services/ske +) + require ( github.com/hashicorp/go-retryablehttp v0.7.7 // indirect golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 // indirect diff --git a/stackit/internal/services/ske/cluster/resource.go b/stackit/internal/services/ske/cluster/resource.go index a6801caa2..5e554fe5d 100644 --- a/stackit/internal/services/ske/cluster/resource.go +++ b/stackit/internal/services/ske/cluster/resource.go @@ -891,10 +891,29 @@ func (r *clusterResource) createOrUpdateCluster(ctx context.Context, diags *diag core.LogAndAddError(ctx, diags, "Error creating/updating cluster", fmt.Sprintf("Cluster creation waiting: %v", err)) return } + if waitResp.Status.Error != nil && waitResp.Status.Error.Message != nil && *waitResp.Status.Error.Code == ske.RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND { core.LogAndAddWarning(ctx, diags, "Warning during creating/updating cluster", fmt.Sprintf("Cluster is in Impaired state due to an invalid observability instance id, the cluster is usable but metrics won't be forwarded: %s", *waitResp.Status.Error.Message)) } + var errMsgs []string + if waitResp.Status.Errors != nil && len(*waitResp.Status.Errors) > 0 { + for _, clusterError := range *waitResp.Status.Errors { + if clusterError.Code != nil && clusterError.Message != nil { + errMsgs = append(errMsgs, fmt.Sprintf("- [%s] %s", *clusterError.Code, *clusterError.Message)) + } + } + + if len(errMsgs) > 0 { + core.LogAndAddWarning( + ctx, + diags, + "Warning during creating/updating cluster", + fmt.Sprintf("Cluster creation/update encountered the following issues:\n%s", strings.Join(errMsgs, "\n")), + ) + } + } + err = mapFields(ctx, waitResp, model, region) if err != nil { core.LogAndAddError(ctx, diags, "Error creating/updating cluster", fmt.Sprintf("Processing API payload: %v", err))