diff --git a/pkg/controller/external_tfpluginsdk.go b/pkg/controller/external_tfpluginsdk.go index 9ce3cdb5..5fbe308b 100644 --- a/pkg/controller/external_tfpluginsdk.go +++ b/pkg/controller/external_tfpluginsdk.go @@ -510,7 +510,7 @@ func (n *terraformPluginSDKExternal) Observe(ctx context.Context, mg xpresource. n.instanceDiff = tf.NewInstanceDiff() } - noDiff := n.instanceDiff.Empty() + isDiffEmpty := n.instanceDiff.Empty() if !resourceExists && mg.GetDeletionTimestamp() != nil { gvk := mg.GetObjectKind().GroupVersionKind() @@ -556,11 +556,11 @@ func (n *terraformPluginSDKExternal) Observe(ctx context.Context, mg xpresource. return managed.ExternalObservation{}, errors.Errorf("could not set observation: %v", err) } - if noDiff { + if isDiffEmpty { n.metricRecorder.SetReconcileTime(mg.GetName()) } if !specUpdateRequired { - resource.SetUpToDateCondition(mg, noDiff) + resource.SetUpToDateCondition(mg, isDiffEmpty) } // check for an external-name change if nameChanged, err := n.setExternalName(mg, stateValueMap); err != nil { @@ -572,7 +572,7 @@ func (n *terraformPluginSDKExternal) Observe(ctx context.Context, mg xpresource. return managed.ExternalObservation{ ResourceExists: resourceExists, - ResourceUpToDate: noDiff, + ResourceUpToDate: isDiffEmpty, ConnectionDetails: connDetails, ResourceLateInitialized: specUpdateRequired, }, nil