Skip to content

Commit

Permalink
Log the previous version when patching
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Olshevski committed Dec 13, 2023
1 parent 7551e78 commit d97d575
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/controllers/reconciliation/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func (c *Controller) reconcileResource(ctx context.Context, prev, resource *reco
}

// Compute a merge patch
prevRV := current.GetResourceVersion()
patch, patchType, err := c.buildPatch(ctx, prev, resource, current)
if err != nil {
return fmt.Errorf("building patch: %w", err)
Expand All @@ -146,7 +147,7 @@ func (c *Controller) reconcileResource(ctx context.Context, prev, resource *reco
if err != nil {
return fmt.Errorf("applying patch: %w", err)
}
logger.V(0).Info("patched resource", "patchType", string(patchType), "resourceVersion", current.GetResourceVersion())
logger.V(0).Info("patched resource", "patchType", string(patchType), "resourceVersion", current.GetResourceVersion(), "previousResourceVersion", prevRV)

return nil
}
Expand Down

0 comments on commit d97d575

Please sign in to comment.