Skip to content

Commit

Permalink
Rename noDiff to isDiffEmpty.
Browse files Browse the repository at this point in the history
Signed-off-by: Cem Mergenci <[email protected]>
  • Loading branch information
mergenci committed Jan 16, 2025
1 parent 4c3ed47 commit 10d0d54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/external_tfpluginsdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 10d0d54

Please sign in to comment.