From 056c000acc92576bdf4631681f7ccb78cceb8ba7 Mon Sep 17 00:00:00 2001 From: GokceGK <161626272+GokceGK@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:11:21 +0100 Subject: [PATCH] Update SKE project resource deprecation message (#313) * remove redundant log message * update description and deprecation message for project resource * add missing space * update docs --- docs/resources/ske_project.md | 4 ++-- stackit/internal/services/ske/project/resource.go | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/resources/ske_project.md b/docs/resources/ske_project.md index 6ad5edc5..a5088a58 100644 --- a/docs/resources/ske_project.md +++ b/docs/resources/ske_project.md @@ -3,12 +3,12 @@ page_title: "stackit_ske_project Resource - stackit" subcategory: "" description: |- - SKE project resource schema. Must have a region specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Before deleting this resource, all SKE clusters associated to the project must be deleted. Warning: SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created. + SKE project resource schema. Must have a region specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Before deleting this resource, all SKE clusters associated to the project must be deleted. Otherwise, error would occur due to the existing clusters. In such case, it is highly recommended to remove the SKE project from the state, directly using the "terraform state rm". Warning: SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created. --- # stackit_ske_project (Resource) -SKE project resource schema. Must have a `region` specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Before deleting this resource, all SKE clusters associated to the project must be deleted. Warning: SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created. +SKE project resource schema. Must have a `region` specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Before deleting this resource, all SKE clusters associated to the project must be deleted. Otherwise, error would occur due to the existing clusters. In such case, it is highly recommended to remove the SKE project from the state, directly using the "`terraform state rm`". Warning: SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created. ## Example Usage diff --git a/stackit/internal/services/ske/project/resource.go b/stackit/internal/services/ske/project/resource.go index 9a99adbe..9edf238e 100644 --- a/stackit/internal/services/ske/project/resource.go +++ b/stackit/internal/services/ske/project/resource.go @@ -86,8 +86,11 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR // Schema returns the Terraform schema structure func (r *projectResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ - Description: "SKE project resource schema. Must have a `region` specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Before deleting this resource, all SKE clusters associated to the project must be deleted. Warning: SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created.", - DeprecationMessage: "SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created.", + Description: "SKE project resource schema. Must have a `region` specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. " + + "Before deleting this resource, all SKE clusters associated to the project must be deleted. Otherwise, error would occur due to the existing clusters. In such case, it is highly recommended to remove the SKE project from the state, directly using the \"`terraform state rm`\". " + + "Warning: SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created.", + DeprecationMessage: "SKE project resource is no longer in use and will be removed with the next minor release. SKE service enablement is done automatically when a new cluster is created. " + + "For deleting the SKE project resource, it is highly recommended to remove the SKE project from the state, directly using the \"`terraform state rm`\".", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`\".", @@ -172,8 +175,6 @@ func (r *projectResource) Update(ctx context.Context, _ resource.UpdateRequest, // Delete deletes the resource and removes the Terraform state on success. func (r *projectResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform - core.LogAndAddWarning(ctx, &resp.Diagnostics, "Deleting project", "Deleting this resource will destroy any existing clusters under the project") - var model Model resp.Diagnostics.Append(req.State.Get(ctx, &model)...) if resp.Diagnostics.HasError() {