@@ -16,7 +16,6 @@ import (
1616 "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1717 "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1818 "github.com/hashicorp/terraform-plugin-framework/schema/validator"
19- "github.com/hashicorp/terraform-plugin-log/tflog"
2019 "k8s.io/apimachinery/pkg/util/wait"
2120)
2221
@@ -189,8 +188,6 @@ func (r *providerResource) Create(ctx context.Context, req resource.CreateReques
189188 return
190189 }
191190
192- tflog .Trace (ctx , "created a provider" )
193-
194191 data .From (result .CreateClusterProvider )
195192 resp .Diagnostics .Append (resp .State .Set (ctx , & data )... )
196193}
@@ -235,14 +232,14 @@ func (r *providerResource) Delete(ctx context.Context, req resource.DeleteReques
235232 return
236233 }
237234
238- _ , err := r .client .DeleteCluster (ctx , data .Id .ValueString ())
235+ _ , err := r .client .DeleteClusterProvider (ctx , data .Id .ValueString ())
239236 if err != nil {
240237 resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Unable to delete provider, got error: %s" , err ))
241238 return
242239 }
243240
244241 err = wait .WaitForWithContext (ctx , client .Ticker (5 * time .Second ), func (ctx context.Context ) (bool , error ) {
245- _ , err := r .client .GetCluster (ctx , data .Id .ValueStringPointer ())
242+ _ , err := r .client .GetClusterProvider (ctx , data .Id .ValueString ())
246243 if client .IsNotFound (err ) {
247244 return true , nil
248245 }
@@ -253,8 +250,6 @@ func (r *providerResource) Delete(ctx context.Context, req resource.DeleteReques
253250 resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Error while watiting for provider to be deleted, got error: %s" , err ))
254251 return
255252 }
256-
257- tflog .Trace (ctx , "deleted the provider" )
258253}
259254
260255func (r * providerResource ) ImportState (ctx context.Context , req resource.ImportStateRequest , resp * resource.ImportStateResponse ) {
0 commit comments