operator-controller
operator-controller copied to clipboard
✨ Modify ClusterExtension to use Helm under the hood to apply contents into the cluster
Description
ClusterExtension reconciler needs to perform the following actions:
[See this doc for more detail if possible.]
-
Based on the cluster Extension spec, get the list of bundles from the catalog and perform resolution.
- The resolution here need not use dep.py, it can be simple filtering and sorting as done in extension controller currently.
- Ref: Extension controller code
- Resolution: Extension controller resolution
- The resolution step involves fetching the installed version. Since there are no APIs (like BundleDeployment or App) present in clusters that reference the installed bundle, we need to investigate on listing the installed helm charts or use helm secrets. This also means that when the helm chart is created, we need to store metadata that uniquely identifies an extension.
- The resolution here need not use dep.py, it can be simple filtering and sorting as done in extension controller currently.
-
Unpack the contents of the resolved bundle. For this iteration we can cover only registryV1 bundles from an image source.
- Unpacker interface reference: Unpacker interface
- Image unpacker: Image image unpacker
- Instead of the BundleDeployment API we need to pass in the cluster extension directly.
-
Conversion of registryV1 to plain bundle.
- Conversion logic: Convert registryV1
-
Creating a Helm chart from the resources present in plain bundle.
-
Installing helm chart onto the cluster.
- Helm chart deployer
- We need to be able to inject metadata into the chart that will be required for resolution as mentioned in 1.(iii).
- Currently, we run a post render hook, that adds labels on the objects created by the chart: Post render hook details. Will need to figure out on how to store this info in the helm secret or on the helm chart directory.
Reviewer Checklist
- [ ] API Go Documentation
- [x] Tests: Unit Tests (and E2E Tests, if appropriate)
- [x] Comprehensive Commit Messages
- [x] Links to related GitHub Issue(s)
Deploy Preview for olmv1 ready!
| Name | Link |
|---|---|
| Latest commit | eafc251031d156d2a565ce592197048a2472f674 |
| Latest deploy log | https://app.netlify.com/sites/olmv1/deploys/6658a2435c1e0c00082a1028 |
| Deploy Preview | https://deploy-preview-846--olmv1.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Codecov Report
Attention: Patch coverage is 63.88309% with 173 lines in your changes are missing coverage. Please review.
Project coverage is 75.38%. Comparing base (
a458282) to head (60f4c80). Report is 9 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #846 +/- ##
==========================================
- Coverage 83.18% 75.38% -7.80%
==========================================
Files 15 18 +3
Lines 874 1170 +296
==========================================
+ Hits 727 882 +155
- Misses 102 208 +106
- Partials 45 80 +35
| Flag | Coverage Δ | |
|---|---|---|
| e2e | 56.06% <59.91%> (-6.18%) |
:arrow_down: |
| unit | 50.60% <21.03%> (-24.33%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@tmshort thanks for deconflicting main.go 👍
FYI for reviewers: I've merged a new commit to the branch which re-enables all e2e tests; they should be passing now. If you like, you can view the standalone diff here.
So, after a discussion, we decided to hopefully make it easier on all, to reduce churn on this PR.
We'd like to not make many changes to this PR unless absolutely necessary.
We will be creating follow up PRs for specific issues (e.g. errors fixes #878) Any PRs referenced (except #874) will be re-targeted against the main branch after this PR merges.
Those comments with "OWNER" (usually @varshaprasad96, sorry!) reference an upcoming change to this PR.
The only part remaining to be fixed in this PR are the unit tests - #874 is in progress to handle the same.
Codecov Report
Attention: Patch coverage is 68.35443% with 150 lines in your changes are missing coverage. Please review.
Project coverage is 77.21%. Comparing base (
7727f8f) to head (eafc251). Report is 2 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #846 +/- ##
==========================================
- Coverage 83.18% 77.21% -5.97%
==========================================
Files 15 17 +2
Lines 874 1176 +302
==========================================
+ Hits 727 908 +181
- Misses 102 189 +87
- Partials 45 79 +34
| Flag | Coverage Δ | |
|---|---|---|
| e2e | 59.86% <64.55%> (-2.38%) |
:arrow_down: |
| unit | 58.52% <33.42%> (-16.42%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@everettraven @m1kola @acornett21 PTAL We've rebased the PR and updated the unit tests, and will be going forward with this. Other significant changes to be done have been noted in various issues.