Skip to content

Traefik component: multiple helm chart localBlobs cannot be individually addressed by Flux after transfer #63

@nexus49

Description

@nexus49

Problem

When the github.com/traefik/traefik component is transferred to a local OCI registry via ocm transfer componentversion --copy-resources, both chart resources (chart and crds) are stored as localBlob layers within a single OCI manifest at component-descriptors/github.com/traefik/traefik:<version>.

The component manifest contains two layers with the same media type:

Layer 1: name="chart"  mediaType=application/vnd.cncf.helm.chart.content.v1.tar+gzip
Layer 2: name="crds"   mediaType=application/vnd.cncf.helm.chart.content.v1.tar+gzip

The platform-mesh-operator ResourceSubroutine creates Flux OCIRepository sources from OCM Resource CRs. For localBlob access, it points the OCIRepository to the component descriptor manifest and uses a layerSelector with the helm chart media type.

However, Flux's layerSelector only supports filtering by mediaType and operationnot by OCI layer annotations. This means both the traefik and traefik-crds OCIRepositories resolve to the same (first matching) layer, resulting in the wrong chart being deployed for the CRDs resource.

Source component descriptor

resources:
  - access:
      helmChart: traefik:39.0.0
      helmRepository: https://traefik.github.io/charts
      type: helm
    name: chart
    type: helmChart
  - access:
      helmChart: traefik-crds:39.0.0
      helmRepository: https://traefik.github.io/charts
      type: helm
    name: crds
    type: helmChart

After transfer, both become type: localBlob with only a localReference digest — the helmRepository URL is lost.

Proposed solution

Restructure the traefik component into a parent with sub-components, where each sub-component contains exactly one resource:

github.com/traefik/traefik (parent)
  ├── github.com/traefik/traefik-chart       (chart resource only)
  ├── github.com/traefik/traefik-crd-chart   (crds resource only)
  └── github.com/traefik/traefik-image       (image resource only)

This way, each sub-component's OCI manifest has exactly one helm chart layer, and the layerSelector can unambiguously select it after transfer. The parent component uses componentReferences to tie them together.

This pattern should be applied to any component that has multiple resources of the same media type.

Affected components

Any component with multiple helmChart resources that uses type: helm access (external helm repo reference). Currently known:

  • github.com/traefik/traefik (chart + crds + image)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions