Skip to content

Cannot render multiple bundles with same name in semver template #3174

@Jeansen

Description

@Jeansen

Bug Report

What did you do?
Following the Core Tasks in the documentation, I have a semver template with multiple bundle versions. Rendering it gives me: render: unable to post-process bundle info: duplicate bundle name "cis-operator"

What did you expect to see?
A clear and concise description of what you expected to happen (or insert a code snippet).

Using the following template, catalog_render_template.yaml:

Schema: olm.semver
GenerateMajorChannels: true
GenerateMinorChannels: false
Stable:
  Bundles:
    - Image: proxy-ng:443/quarkus/cis-operator-bdl:1.96.0
    - Image: proxy-ng:443/quarkus/cis-operator-bdl:1.97.0

And running the following command:

opm alpha render-template semver -o yaml < catalog_render_template.yaml > /tmp/catalog.yaml

I'd expect the command to create a catalog.yaml file with all relevant configuration data.

What did you see instead? Under which circumstances?
A clear and concise description of what you expected to happen (or insert a code snippet).

Instead, I get:

2024/02/12 17:18:05 semver "stdin": render: unable to post-process bundle info: duplicate bundle name "cis-operator"

and the catalog.yaml is empty!

Environment

  • operator-lifecycle-manager version:

0.26.0

  • Kubernetes version information:

1.29.0

  • Kubernetes cluster kind:

Bare metal, kubeadm.
Possible Solution

Additional context
Add any other context about the problem here.

If one removes the second Entry from the template, e.g.

Schema: olm.semver
GenerateMajorChannels: true
GenerateMinorChannels: false
Stable:
  Bundles:
    - Image: proxy-ng:443/quarkus/cis-operator-bdl:1.96.0

Then, the render command succeeds and the catalog is filled with:

---
defaultChannel: stable-v1
name: cis-operator
schema: olm.package
---
entries:
- name: cis-operator
name: stable-v1
package: cis-operator
schema: olm.channel
---
image: proxy-ng:443/quarkus/cis-operator-bdl:1.96.0
name: cis-operator
package: cis-operator
properties:
- type: olm.gvk
  value:
    group: example.cis
    kind: CisOperator
    version: v1
- type: olm.package
  value:
    packageName: cis-operator
    version: 1.96.0
- type: olm.csv.metadata
  value:
    apiServiceDefinitions: {}
    crdDescriptions:
      owned:
      - kind: CisOperator
        name: cisoperators.example.cis
        version: v1
    displayName: cis-operator
    installModes:
    - supported: true
      type: AllNamespaces
    provider: {}
relatedImages:
- image: proxy-ng:443/quarkus/cis-operator-bdl:1.96.0
  name: ""
- image: proxy-ng:443/quarkus/cis-operator:1.96.0
  name: ""
schema: olm.bundle

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions