operator-sdk
operator-sdk copied to clipboard
fix: consider version when getting CRDs for validating descriptors
Description of the change:
An additional condition is included for matching apiVersion
of example CRs with CRD version
when searching for the CRD in the CSV.
Motivation for the change:
Previously, the olm-spec-descriptors
scorecard test failed when multiple versions of CRD are included in the CSV. The CRs specified in alm-examples
annotations are validated only against the first matched CRD (by kind), which is incorrect. This ensures the CRD with correct kind and version is selected for descriptor scorecard test.
Checklist
If the pull request includes user-facing changes, extra documentation is required:
- [x] Add a new changelog fragment in
changelog/fragments
(seechangelog/fragments/00-template.yaml
) - [ ] Add or update relevant sections of the docs website in
website/content/en/docs
Fixes #6781