From 97574578a33cadb8b7f34d7a2d79a1bb704a7eff Mon Sep 17 00:00:00 2001 From: Deep Mistry Date: Mon, 26 Jan 2026 10:16:33 -0500 Subject: [PATCH] Fix image sync detection to log both source and target digests for debugging --- cmd/ci-images-mirror/main.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/ci-images-mirror/main.go b/cmd/ci-images-mirror/main.go index ef22e3c428..ab145161c6 100644 --- a/cmd/ci-images-mirror/main.go +++ b/cmd/ci-images-mirror/main.go @@ -187,12 +187,20 @@ func (s *supplementalCIImagesServiceWithMirrorStore) Mirror(m map[string]quayioc continue } - // Skip if digests match + // Skip if digests match (both must be non-empty to compare) + // If target doesn't exist (empty digest), we need to sync if targetInfo.Digest != "" && sourceInfo.Digest != "" && targetInfo.Digest == sourceInfo.Digest { - s.logger.WithField("target", targetImage).WithField("digest", targetInfo.Digest).Debug("Image already in sync, skipping") + s.logger.WithField("target", targetImage).WithField("source", source). + WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest). + Debug("Image already in sync, skipping") continue } + // Log sync needed with digest details for debugging + s.logger.WithField("source", source).WithField("target", targetImage). + WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest). + Info("Image needs sync") + s.logger.WithField("source", source).WithField("target", targetImage). WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest). Info("Image needs sync")