operator-controller icon indicating copy to clipboard operation
operator-controller copied to clipboard

✨ Modify ClusterExtension to use Helm under the hood to apply contents into the cluster

Open bentito opened this issue 1 year ago • 5 comments

Description

ClusterExtension reconciler needs to perform the following actions:

[See this doc for more detail if possible.]

  1. 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.
      1. Ref: Extension controller code
      2. Resolution: Extension controller resolution
      3. 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.
  2. Unpack the contents of the resolved bundle. For this iteration we can cover only registryV1 bundles from an image source.

  3. Conversion of registryV1 to plain bundle.

  4. Creating a Helm chart from the resources present in plain bundle.

  5. 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)

bentito avatar May 10 '24 21:05 bentito

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...

QR Code

Use your smartphone camera to open QR code link.

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

netlify[bot] avatar May 10 '24 21:05 netlify[bot]

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.

Files Patch % Lines
...nternal/controllers/clusterextension_controller.go 62.02% 94 Missing and 26 partials :warning:
internal/handler/registry.go 62.26% 10 Missing and 10 partials :warning:
internal/controllers/clusterextension_status.go 45.71% 19 Missing :warning:
cmd/manager/main.go 75.86% 9 Missing and 5 partials :warning:
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.

codecov[bot] avatar May 11 '24 13:05 codecov[bot]

@tmshort thanks for deconflicting main.go 👍

bentito avatar May 12 '24 13:05 bentito

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.

dtfranz avatar May 17 '24 22:05 dtfranz

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.

tmshort avatar May 21 '24 19:05 tmshort

The only part remaining to be fixed in this PR are the unit tests - #874 is in progress to handle the same.

varshaprasad96 avatar May 23 '24 19:05 varshaprasad96

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.

Files Patch % Lines
...nternal/controllers/clusterextension_controller.go 67.43% 75 Missing and 24 partials :warning:
internal/handler/registry.go 62.26% 10 Missing and 10 partials :warning:
internal/controllers/common_controller.go 58.53% 17 Missing :warning:
cmd/manager/main.go 75.43% 9 Missing and 5 partials :warning:
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.

codecov-commenter avatar May 23 '24 19:05 codecov-commenter

@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.

tmshort avatar May 29 '24 14:05 tmshort