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

render: support rendering DC from packagemanifest and bundle directories

Open joelanford opened this issue 4 years ago • 3 comments

Description of the change: This PR adds support to the opm render command for package manifest and bundle directories.

Two notes:

  1. When rendering bundle directories, there is no metadata about the bundle image reference, so the declarative config rendered from a bundle directory contains inlined olm.bundle.object properties but lacks an image value.

    However callers of opm render with bundle directories will generally know the image that will contain the bundle directory, so they can insert the bundle image reference themselves, e.g. with jq:

    opm render ./my-bundle | jq '.image="quay.io/my-org/my-bundle:0.1.0"'
    
  2. Rendering a package manifest is done by loading the package into a temporary sqlite database, and then converting the database to declarative config. The consequence is that support for rendering package manifests will likely be removed when sqlite support is removed.

Motivation for the change: Make opm render more versatile.

Reviewer Checklist

  • [x] Implementation matches the proposed design, or proposal is updated to match implementation
  • [x] Sufficient unit test coverage
  • [ ] Sufficient end-to-end test coverage
  • [ ] Docs updated or added to /docs
  • [ ] Commit messages sensible and descriptive

joelanford avatar Aug 13 '21 01:08 joelanford

Codecov Report

Attention: Patch coverage is 72.22222% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 53.88%. Comparing base (d74ce59) to head (8b20b15). Report is 6 commits behind head on master.

Files Patch % Lines
alpha/action/render.go 72.22% 10 Missing and 10 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #748      +/-   ##
==========================================
+ Coverage   53.80%   53.88%   +0.08%     
==========================================
  Files         108      108              
  Lines       10368    10436      +68     
==========================================
+ Hits         5578     5623      +45     
- Misses       3808     3823      +15     
- Partials      982      990       +8     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 13 '21 01:08 codecov[bot]

/hold We might not need this, at least not urgently.

joelanford avatar Aug 18 '21 00:08 joelanford

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Aug 19 '21 00:08 openshift-ci[bot]

/lgtm

grokspawn avatar Jan 31 '24 14:01 grokspawn

/lgtm

grokspawn avatar Feb 27 '24 20:02 grokspawn