Skip to content

Conversation

@flavianmissi
Copy link
Member

the Image REST strategy logs errors when it cannot parse the raw json manifest when creating an Image object. however, this is not an error, as a call to this api might have already cleared the DockerImageManifest from the Image object.

The diff doesn't make it so obvious, but the only change in this PR is to wrap manifest json parsing and submanifest creation into a condition that checks if the raw manifest is present.

/assign @ricardomaraschini

@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 9, 2025
@openshift-ci-robot
Copy link

@flavianmissi: This pull request references Jira Issue OCPBUGS-37215, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

the Image REST strategy logs errors when it cannot parse the raw json manifest when creating an Image object. however, this is not an error, as a call to this api might have already cleared the DockerImageManifest from the Image object.

The diff doesn't make it so obvious, but the only change in this PR is to wrap manifest json parsing and submanifest creation into a condition that checks if the raw manifest is present.

/assign @ricardomaraschini

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Sep 9, 2025

Walkthrough

Adds a conditional guard in PrepareForCreate to only parse DockerImageManifest when present; moves UnmarshalManifest inside the guard, preserves error handling, and when a manifest list is detected, builds and assigns DockerImageManifests with extracted metadata. Adds comments clarifying two contexts and limits manifest-related variable scope.

Changes

Cohort / File(s) Summary
Image manifest processing guard and metadata extraction
pkg/image/apiserver/registry/image/strategy.go
- Skip manifest parsing when DockerImageManifest is empty in PrepareForCreate
- Move UnmarshalManifest inside guard with existing error handling
- On manifest list, construct and assign DockerImageManifests (Digest, MediaType, ManifestSize, Architecture, OS, Variant)
- Add contextual comments (image stream import vs direct push) and tighten variable scope

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed Title clearly summarizes the primary change by indicating that the pkg/image logic now conditionally parses the raw image manifest, matching the pull request’s focus without unnecessary detail.
Description Check ✅ Passed Description accurately explains the rationale and specific conditional change applied to manifest parsing, making it directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 11edcfa and f30057f.

📒 Files selected for processing (1)
  • pkg/image/apiserver/registry/image/strategy.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/image/apiserver/registry/image/strategy.go
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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 Sep 9, 2025
Copy link

@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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between e817f84 and 4f25a81.

📒 Files selected for processing (1)
  • pkg/image/apiserver/registry/image/strategy.go (1 hunks)

the Image REST strategy logs errors when it cannot parse the raw json
manifest when creating an Image object. however, this is not an error,
as a call to this api might have already cleared the DockerImageManifest
from the Image object.
@flavianmissi
Copy link
Member Author

test failure is unrelated
/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 9, 2025

@flavianmissi: all tests passed!

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.

@ricardomaraschini
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flavianmissi, ricardomaraschini

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

@xiuwang
Copy link

xiuwang commented Sep 12, 2025

/verified by @xiuwang

@xiuwang
Copy link

xiuwang commented Sep 12, 2025

/label qe-approved

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 12, 2025
@openshift-ci-robot
Copy link

@xiuwang: This PR has been marked as verified by @xiuwang.

Details

In response to this:

/verified by @xiuwang

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Sep 12, 2025
@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 12, 2025
@openshift-ci-robot
Copy link

@flavianmissi: This pull request references Jira Issue OCPBUGS-37215, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira ([email protected]), skipping review request.

Details

In response to this:

the Image REST strategy logs errors when it cannot parse the raw json manifest when creating an Image object. however, this is not an error, as a call to this api might have already cleared the DockerImageManifest from the Image object.

The diff doesn't make it so obvious, but the only change in this PR is to wrap manifest json parsing and submanifest creation into a condition that checks if the raw manifest is present.

/assign @ricardomaraschini

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 6301ea5 into openshift:main Sep 12, 2025
14 checks passed
@openshift-ci-robot
Copy link

@flavianmissi: Jira Issue Verification Checks: Jira Issue OCPBUGS-37215
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-37215 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

the Image REST strategy logs errors when it cannot parse the raw json manifest when creating an Image object. however, this is not an error, as a call to this api might have already cleared the DockerImageManifest from the Image object.

The diff doesn't make it so obvious, but the only change in this PR is to wrap manifest json parsing and submanifest creation into a condition that checks if the raw manifest is present.

/assign @ricardomaraschini

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 openshift-eng/jira-lifecycle-plugin repository.

@flavianmissi flavianmissi deleted the OCPBUGS-37215 branch September 19, 2025 12:53
@flavianmissi
Copy link
Member Author

/cherry-pick release-4.20

@openshift-cherrypick-robot

@flavianmissi: new pull request created: #559

Details

In response to this:

/cherry-pick release-4.20

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-merge-robot
Copy link
Contributor

Fix included in accepted release 4.21.0-0.nightly-2025-09-13-162334

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. jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants