Skip to content

Stop Relying on opm Embedded in Catalog Index Images #3019

Open
@stevekuznetsov

Description

@stevekuznetsov

Today, when a CatalogSource is created, the Pod that serves catalog content uses opm to do so; the version of the server that's used is whichever version happens to be bundled into the index image. This design has a couple of draw-backs:

  • it's very difficult to reason about which versions of opm are used
  • updating opm requires rebuilding all catalogs
  • testing changes to opm requires the same
  • downstream consumers of the catalog cannot make many assumptions around what version of opm they might encounter in a catalog and what they can assume of it

When the data model was tightly coupled to the binary reading it (at the time from SQLite), bundling both the content and the server made a lot of sense. Today, though, it's possible we're not in that state any longer, as the move to FBC has given us a) a stable format and b) a non-obfuscated storage mechanism.


The catalog-operator already has an --opmImage flag to consume a well-known image containing opm to use, so implementing this feature will only require us to add a new field to the CatalogSource to opt catalogs into this:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: redhat-operators
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  grpcPodConfig:
    extractContent:
      cacheDir: /var/cache/
      configDir: /var/config/

Then, the catalog-operator can create a Pod that:

  • runs an init-container with the index image, which copies the cache and config dirs into a shared EmptyDir
  • run the well-known --opmImage in a container, passing the two directories to it.

Open Questions:

  • today, opm is deserializing the content of the catalog on disk to validate the cache; if new fields are added to FBC, an older opm will not be able to understand those fields and will fail to reproduce the hash - what should we do?
    • we could add an init container with the provided index image to validate the hash, and forgo the check in the main server as long as opm faithfully serves cache content without pruning unknown fields
    • we could not make additions to the FBC schema (are we generic enough today that new schema won't occur?)
  • in general, what other concerns are there for version skew? what's our support statement for catalogs on older clusters? can we guarantee that older catalogs are built with older opm versions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions