-
Notifications
You must be signed in to change notification settings - Fork 296
Fix image sync detection to log both source and target digests for debugging #4908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
WalkthroughA single file receives logging enhancements and comment clarifications in the mirror digest comparison logic. The changes add detailed logging when digests match, insert debug information via "Image needs sync" messages, and expand comments to clarify target digest behavior. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmd/ci-images-mirror/main.go (1)
199-207: Remove duplicate “Image needs sync” log entry.Two identical Info logs will fire back-to-back, producing redundant noise. Keep only one.
🛠️ Proposed fix
- // 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")
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deepsm007, Prucek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Scheduling required tests: Scheduling tests matching the |
|
@deepsm007: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Improves logging in
ci-images-mirrorto include both source and target digests when skipping image sync operations.Currently, when
ci-images-mirrordetermines that an image is already in sync (source and target digests match), it logs a debug message but only includes the target digest. This makes it difficult to debug cases where:The "Image needs sync" log already includes both digests for comparison, but the "already in sync" log was missing this critical information.
Manual verification showed the images are out of sync:
Source image (internal registry for app.ci): Release label
202601261115.p2.gf3ceb77.assembly.stream.el9Target image (QCI): Release label
202601201943.p2.g7a68b22.assembly.stream.el9Example
Before:
{"level":"debug","msg":"Image already in sync, skipping","target":"quay.io/openshift/ci:ocp_4.22_base-rhel9","digest":"sha256:3955031d..."}
After:
{"level":"debug","msg":"Image already in sync, skipping","target":"quay.io/openshift/ci:ocp_4.22_base-rhel9","source":"registry.ci.openshift.org/ocp/4.22:base-rhel9","sourceDigest":"sha256:3955031d...","targetDigest":"sha256:3955031d..."}