MCO-2468: Cache backed OSImageStreams for PIS - #6329
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@pablintino: This pull request references MCO-2468 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (6)
WalkthroughChangesPinned image cache warming
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PinnedImageSetController
participant CacheWarmer
participant PinnedImageSetLister
participant ImagesInspector
participant InspectionCache
PinnedImageSetController->>CacheWarmer: Request warm
CacheWarmer->>PinnedImageSetLister: List PinnedImageSets
CacheWarmer->>ImagesInspector: Inspect unique pinned images
CacheWarmer->>ImagesInspector: Fetch release manifest
ImagesInspector->>InspectionCache: Populate inspection entries
Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (12 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pablintino 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/controller/pinnedimageset/cache_warmer.go (1)
118-121: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider logging inspection errors, not just fetch errors.
r.Error != nilis silently skipped; onlyFetchImageFilefailures are logged (Line 125-127). Logging inspection failures too would help diagnose why warming silently fails to warm a given image.📝 Proposed fix
for _, r := range results { - if r.Error != nil || r.InspectInfo == nil || !osimagestream.IsReleasePayload(r.InspectInfo.Labels) { + if r.Error != nil { + klog.Warningf("PIS cache warmer: failed to inspect %s: %v", r.Image, r.Error) + continue + } + if r.InspectInfo == nil || !osimagestream.IsReleasePayload(r.InspectInfo.Labels) { continue }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/controller/pinnedimageset/cache_warmer.go` around lines 118 - 121, Update the results loop in the cache-warming flow to log each non-nil r.Error before continuing, alongside the existing FetchImageFile failure logging. Include enough context to identify the affected image, while preserving the current skips for missing InspectInfo and non-release payloads.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/controller/pinnedimageset/cache_warmer.go`:
- Around line 96-131: Update CacheWarmer.Warm to derive a per-cycle timeout
context from ctx before calling inspector.Inspect and inspector.FetchImageFile.
Use the configured or established warm-cycle timeout symbol, defer its
cancellation, and pass the derived context to both registry calls so each Warm
invocation is bounded while preserving the existing error handling and shutdown
cancellation.
---
Nitpick comments:
In `@pkg/controller/pinnedimageset/cache_warmer.go`:
- Around line 118-121: Update the results loop in the cache-warming flow to log
each non-nil r.Error before continuing, alongside the existing FetchImageFile
failure logging. Include enough context to identify the affected image, while
preserving the current skips for missing InspectInfo and non-release payloads.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: efb19ced-6a2c-47a8-b014-41a4ea05e459
📒 Files selected for processing (6)
cmd/machine-config-controller/start.gopkg/controller/pinnedimageset/cache_warmer.gopkg/controller/pinnedimageset/cache_warmer_test.gopkg/controller/pinnedimageset/pinned_image_set.gopkg/controller/pinnedimageset/pinned_image_set_test.gopkg/osimagestream/image_data.go
This change leverages the recently added inspection cache to allow disconnected environments using PIS to be able to discover streams. Signed-off-by: Pablo Rodriguez Nava <git@amail.pablintino.eu>
|
/pipeline required |
|
Scheduling tests matching the |
|
/test unit |
|
@pablintino: all tests passed! 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. |
|
/hold Holding to allow the Kube rebase to land in #6321. Please ensure this will not cause merge conflicts for the Kube rebase before unholding this PR. |
- What I did
This change leverages the recently added inspection cache to allow disconnected environments using PIS to be able to discover streams.
- How to verify it
TBD
- Description for the changelog
This change leverages the recently added inspection cache to allow disconnected environments using PIS to be able to discover streams.
Summary by CodeRabbit