Description
Describe the bug
We maintain the Datadog Agent Operator and one of its CRDs (DatadogAgent
) has two versions,v2alpha1
(new) and v1alpha1
(old). Both CRDs are included in the clusterserviceversion.yaml
and when alm-examples
are provided for each CRD version, only the 1st listed example is displayed. This issue occurs in the https://operatorhub.io/preview page. I haven't pushed an updated clusterserviceversion.yaml
file containing the new examples, so I haven't been able to confirm whether the problem occurs in the http://operatorhub.io listed operator tiles, but I can update the issue if I do see it happening
What did you do?
A clear and concise description of the steps you took. For example, steps to reproduce the behavior:
- Go to 'https://operatorhub.io/preview'
- Paste contents of a
clusterserviceversion.yaml
file of CRDs containing more than 1apiVersion
for a given CRDkind
. Example: https://gist.github.com/fanny-jiang/4f1829eb3262d47ebd64050a59fd7ec4 - Scroll down to 'Custom Resource Definitions'
- Click each tile for the given CRD (i.e.
DatadogAgent
). - Observe that the 1st tile displays the 1st defined YAML example of the
alm-examples
list for the given CRDkind: DatadogAgent
, showingapiVersion: v1alpha1
- Observe that the 2nd tile also displays the YAML example for
apiVersion: v1alpha1
What did you expect to see?
I expected to see one CRD tile for each apiVersion
of a given CRD kind
name displaying the YAML example corresponding to its apiVersion
.
Tile 1 with name DatadogAgent
should display a YAML example for apiVersion: v1alpha1
.
Tile 2 with the name DatadogAgent
should display a YAML example for apiVersion: v2alpha
.
What did you see instead?
Instead, I see 2 CRD tiles with the kind: DatadogAgent
, both displaying YAML examples for apiVersion: v1alpha1
.
Additional context
I notice that when I switch the order of the examples in the alm-examples
list, whichever is listed first is displayed in the UI. For example, if the example for v2alpha1
is listed before v1alpha1
, the UI displays v2alpha1
, and vice versa.
alm-examples: |-
[
<v2alpha2_example>, <= displayed in UI
<v1alpha1_example>,
...
]