From b41dfff13e37e94196510291e88635c93c2dbc8e Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Tue, 16 Jan 2024 12:25:38 +0300 Subject: [PATCH] minor log message and naming changes Signed-off-by: Erhan Cagirici --- pkg/controller/external_async_terraform_plugin_framework.go | 4 ++-- pkg/controller/external_terraform_plugin_framework.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/controller/external_async_terraform_plugin_framework.go b/pkg/controller/external_async_terraform_plugin_framework.go index 1bc6a991..bd3fb9de 100644 --- a/pkg/controller/external_async_terraform_plugin_framework.go +++ b/pkg/controller/external_async_terraform_plugin_framework.go @@ -47,7 +47,7 @@ func NewTerraformPluginFrameworkAsyncConnector(kube client.Client, func (c *TerraformPluginFrameworkAsyncConnector) Connect(ctx context.Context, mg xpresource.Managed) (managed.ExternalClient, error) { ec, err := c.TerraformPluginFrameworkConnector.Connect(ctx, mg) if err != nil { - return nil, errors.Wrap(err, "cannot initialize the no-fork async external client") + return nil, errors.Wrap(err, "cannot initialize the Terraform Plugin Framework async external client") } return &terraformPluginFrameworkAsyncExternalClient{ @@ -58,7 +58,7 @@ func (c *TerraformPluginFrameworkAsyncConnector) Connect(ctx context.Context, mg } // WithTerraformPluginFrameworkAsyncConnectorEventHandler configures the EventHandler so that -// the no-fork external clients can requeue reconciliation requests. +// the Terraform Plugin Framework external clients can requeue reconciliation requests. func WithTerraformPluginFrameworkAsyncConnectorEventHandler(e *handler.EventHandler) TerraformPluginFrameworkAsyncOption { return func(c *TerraformPluginFrameworkAsyncConnector) { c.eventHandler = e diff --git a/pkg/controller/external_terraform_plugin_framework.go b/pkg/controller/external_terraform_plugin_framework.go index d20cf47b..f633f5d2 100644 --- a/pkg/controller/external_terraform_plugin_framework.go +++ b/pkg/controller/external_terraform_plugin_framework.go @@ -440,7 +440,7 @@ func (n *terraformPluginFrameworkExternalClient) Update(ctx context.Context, mg return managed.ExternalUpdate{}, errors.Wrap(err, "cannot update resource") } if fatalDiags := getFatalDiagnostics(applyResponse.Diagnostics); fatalDiags != nil { - return managed.ExternalUpdate{}, errors.Errorf("resource update failed") + return managed.ExternalUpdate{}, errors.Wrap(fatalDiags, "resource update failed") } n.opTracker.SetFrameworkTFState(applyResponse.NewState) @@ -480,7 +480,7 @@ func (n *terraformPluginFrameworkExternalClient) Delete(ctx context.Context, _ x // set an empty planned state, this corresponds to deleting plannedState, err := tfprotov5.NewDynamicValue(schemaType, tftypes.NewValue(schemaType, nil)) if err != nil { - return errors.Wrap(err, "cannot set the planned state") + return errors.Wrap(err, "cannot set the planned state for deletion") } applyRequest := &tfprotov5.ApplyResourceChangeRequest{ @@ -502,7 +502,7 @@ func (n *terraformPluginFrameworkExternalClient) Delete(ctx context.Context, _ x newStateAfterApplyVal, err := applyResponse.NewState.Unmarshal(schemaType) if err != nil { - return errors.Wrap(err, "cannot unmarshal updated state") + return errors.Wrap(err, "cannot unmarshal state after deletion") } // mark the resource as logically deleted if the TF call clears the state n.opTracker.SetDeleted(newStateAfterApplyVal.IsNull())