Skip to content
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

🐛 Ensure catalog caches are valid after restart #1669

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

oceanc80
Copy link
Contributor

@oceanc80 oceanc80 commented Jan 30, 2025

Description

This addresses an intermittent failure we've seen where operator-controller appears to not resolve catalogs that exist. We identified the issue coming from the catalog caches not being valid after a restart.

This PR adds two things to address this issue:

  • On startup of the binary, always clear the catalog cache directory

The PR also includes some small refactoring and fixes:

  • moves certain unpack functions to an util package and are now shared by catalog and bundle image unpacker
  • if unpack path happens to be an existing file, we delete it and unpack the image

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 30, 2025
Copy link

netlify bot commented Jan 30, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit edba970
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/679bab669b314800080d6ab5
😎 Deploy Preview https://deploy-preview-1669--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@perdasilva perdasilva force-pushed the refresh-cache-on-start branch from 99cb71a to 54fed0f Compare January 30, 2025 10:26
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 41.66667% with 56 lines in your changes missing coverage. Please review.

Project coverage is 67.41%. Comparing base (158d974) to head (edba970).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
internal/rukpak/source/util.go 50.87% 22 Missing and 6 partials ⚠️
catalogd/internal/source/containers_image.go 18.18% 3 Missing and 6 partials ⚠️
internal/util/fs.go 30.00% 5 Missing and 2 partials ⚠️
internal/rukpak/source/containers_image.go 40.00% 3 Missing and 3 partials ⚠️
cmd/operator-controller/main.go 33.33% 3 Missing and 1 partial ⚠️
catalogd/cmd/catalogd/main.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1669      +/-   ##
==========================================
- Coverage   67.42%   67.41%   -0.01%     
==========================================
  Files          55       57       +2     
  Lines        4632     4619      -13     
==========================================
- Hits         3123     3114       -9     
+ Misses       1284     1278       -6     
- Partials      225      227       +2     
Flag Coverage Δ
e2e 53.31% <38.55%> (+0.01%) ⬆️
unit 54.27% <39.58%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@perdasilva perdasilva force-pushed the refresh-cache-on-start branch 4 times, most recently from 4f95510 to 75e06d1 Compare January 30, 2025 13:52
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass looks good to me.

One more overall comment: we should put this same set of changes in operator-controller's main.go and containers_image.go files.

@perdasilva perdasilva force-pushed the refresh-cache-on-start branch 2 times, most recently from bc1db72 to 3f3a2e4 Compare January 30, 2025 16:20
@perdasilva perdasilva force-pushed the refresh-cache-on-start branch from 3f3a2e4 to edba970 Compare January 30, 2025 16:40
@perdasilva perdasilva marked this pull request as ready for review January 30, 2025 17:14
@perdasilva perdasilva requested a review from a team as a code owner January 30, 2025 17:14
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 30, 2025
@joelanford joelanford added this pull request to the merge queue Jan 30, 2025
Merged via the queue into operator-framework:main with commit 3998a3b Jan 30, 2025
21 of 23 checks passed
@oceanc80 oceanc80 deleted the refresh-cache-on-start branch January 30, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants