Skip to content

Commit

Permalink
minor log message and naming changes
Browse files Browse the repository at this point in the history
Signed-off-by: Erhan Cagirici <[email protected]>
  • Loading branch information
erhancagirici committed Jan 16, 2024
1 parent 86fec36 commit b41dfff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/external_async_terraform_plugin_framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/external_terraform_plugin_framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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{
Expand All @@ -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())
Expand Down

0 comments on commit b41dfff

Please sign in to comment.