Fix image sync detection to log both source and target digests for debugging#4908
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
WalkthroughA single file updates mirror digest comparison: the skip-path logging now includes source, sourceDigest, and targetDigest (with non-empty digest check), an informational "Image needs sync" log was added before mirroring, and comments were expanded to clarify target-digest behavior. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.5.0)Command failed Tip We've launched Issue Planner and it is currently in beta. Please try it out and share your feedback on Discord! Comment |
There was a problem hiding this comment.
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")
|
Scheduling required tests: Scheduling tests matching the |
|
/override ci/prow/integration-optional-test |
|
/override ci/prow/breaking-changes |
|
@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/integration-optional-test DetailsIn response to this:
Instructions 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. |
|
@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/breaking-changes DetailsIn response to this:
Instructions 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. |
9757457 to
9b1d725
Compare
|
[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 |
|
/override ci/prow/e2e |
|
@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/e2e DetailsIn response to this:
Instructions 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. |
|
/override ci/prow/images |
|
@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/images DetailsIn response to this:
Instructions 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. |
|
@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. |
9595980
into
openshift:main
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..."}