Skip to content

Commit 9b1d725

Browse files
committed
Fix image sync detection to log both source and target digests for debugging
1 parent d7866ae commit 9b1d725

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

cmd/ci-images-mirror/main.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,20 @@ func (s *supplementalCIImagesServiceWithMirrorStore) Mirror(m map[string]quayioc
187187
continue
188188
}
189189

190-
// Skip if digests match
190+
// Skip if digests match (both must be non-empty to compare)
191+
// If target doesn't exist (empty digest), we need to sync
191192
if targetInfo.Digest != "" && sourceInfo.Digest != "" && targetInfo.Digest == sourceInfo.Digest {
192-
s.logger.WithField("target", targetImage).WithField("digest", targetInfo.Digest).Debug("Image already in sync, skipping")
193+
s.logger.WithField("target", targetImage).WithField("source", source).
194+
WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest).
195+
Debug("Image already in sync, skipping")
193196
continue
194197
}
195198

199+
// Log sync needed with digest details for debugging
200+
s.logger.WithField("source", source).WithField("target", targetImage).
201+
WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest).
202+
Info("Image needs sync")
203+
196204
s.logger.WithField("source", source).WithField("target", targetImage).
197205
WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest).
198206
Info("Image needs sync")

0 commit comments

Comments
 (0)