Skip to content

Fix image sync detection to log both source and target digests for debugging#4908

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
deepsm007:fix-image-sync-detection
Feb 10, 2026
Merged

Fix image sync detection to log both source and target digests for debugging#4908
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
deepsm007:fix-image-sync-detection

Conversation

@deepsm007
Copy link
Copy Markdown
Contributor

Improves logging in ci-images-mirror to include both source and target digests when skipping image sync operations.

Currently, when ci-images-mirror determines 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:

  • Images appear to be out of sync (e.g., different release labels) but are marked as "already in sync"
  • The digest comparison logic needs verification
  • Troubleshooting requires manual cross-referencing of multiple log entries

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.el9
Target image (QCI): Release label 202601201943.p2.g7a68b22.assembly.stream.el9

Example

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..."}

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 26, 2026

Walkthrough

A 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

Cohort / File(s) Summary
Logging & comment updates
cmd/ci-images-mirror/main.go
Refined skip-path logging to include source, sourceDigest, and targetDigest (only compared when non-empty), added an info log "Image needs sync" with source, target, sourceDigest, targetDigest before continuing, and expanded comments explaining target-digest empty-case.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a 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")

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9c27eed and 2 for PR HEAD 9757457 in total

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test integration-optional-test

@deepsm007
Copy link
Copy Markdown
Contributor Author

/override ci/prow/integration-optional-test

@deepsm007
Copy link
Copy Markdown
Contributor Author

/override ci/prow/breaking-changes

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Feb 10, 2026

@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/integration-optional-test

Details

In response to this:

/override ci/prow/integration-optional-test

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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Feb 10, 2026

@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/breaking-changes

Details

In response to this:

/override ci/prow/breaking-changes

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 deepsm007 force-pushed the fix-image-sync-detection branch from 9757457 to 9b1d725 Compare February 10, 2026 14:38
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2026
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Feb 10, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepsm007
Copy link
Copy Markdown
Contributor Author

/override ci/prow/e2e

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Feb 10, 2026

@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/e2e

Details

In response to this:

/override ci/prow/e2e

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
Copy link
Copy Markdown
Contributor Author

/override ci/prow/images

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Feb 10, 2026

@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/images

Details

In response to this:

/override ci/prow/images

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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Feb 10, 2026

@deepsm007: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/breaking-changes 9b1d725 link false /test breaking-changes

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 9595980 into openshift:main Feb 10, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants