🐛 Ensure catalog caches are valid after restart by oceanc80 · Pull Request #1669 · operator-framework/operator-controller
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)