Skip to content

Commit 69ab9c3

Browse files
joelanfordhasbro17
authored andcommitted
internal/pkg/scaffold/olm-catalog/csv_updaters.go: fix applying owned CRDs (#2017)
* internal/pkg/scaffold/olm-catalog/csv_updaters.go: fix applying owned CRDs * CHANGELOG.md: add line for #2017 (cherry picked from commit 5bfe311)
1 parent cd0711c commit 69ab9c3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
## Unreleased
22

3-
### Bug Fixes
4-
5-
- The command `operator-sdk olm-catalog gen-csv --csv-version=<version> --update-crds` would fail to copy over CRD manifests into `deploy/olm-catalog` for manifests whose name didn't end with a `_crd.yaml` suffix. This has been fixed so `gen-csv` now copies all CRD manifests specified by `deploy/olm-catalog/csv_config.yaml` by checking the type of the manifest rather than the filename suffix. ([#2015](https://github.com/operator-framework/operator-sdk/pull/2015))
6-
73
### Added
84

95
### Changed
@@ -14,6 +10,9 @@
1410

1511
### Bug Fixes
1612

13+
- The command `operator-sdk olm-catalog gen-csv --csv-version=<version> --update-crds` would fail to copy over CRD manifests into `deploy/olm-catalog` for manifests whose name didn't end with a `_crd.yaml` suffix. This has been fixed so `gen-csv` now copies all CRD manifests specified by `deploy/olm-catalog/csv_config.yaml` by checking the type of the manifest rather than the filename suffix. ([#2015](https://github.com/operator-framework/operator-sdk/pull/2015))
14+
- Fixed an issue in `operator-sdk olm-catalog gen-csv` where the generated CSV is missing the expected set of owned CRDs. ([#2017](https://github.com/operator-framework/operator-sdk/pull/2017))
15+
1716
## v0.10.0
1817

1918
### Added

internal/pkg/scaffold/olm-catalog/csv_updaters.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,12 @@ func getGVKID(g, v, k string) string {
305305
// the CRD key is not in spec.customresourcedefinitions.owned already.
306306
func (u *CustomResourceDefinitionsUpdate) Apply(csv *olmapiv1alpha1.ClusterServiceVersion) error {
307307
set := make(map[string]olmapiv1alpha1.CRDDescription)
308-
for _, uDesc := range u.Owned {
309-
set[crdDescID(uDesc)] = uDesc
308+
for _, csvDesc := range csv.Spec.CustomResourceDefinitions.Owned {
309+
set[crdDescID(csvDesc)] = csvDesc
310310
}
311311
newDescs := []olmapiv1alpha1.CRDDescription{}
312-
for _, csvDesc := range csv.Spec.CustomResourceDefinitions.Owned {
313-
if uDesc, ok := set[crdDescID(csvDesc)]; !ok {
312+
for _, uDesc := range u.Owned {
313+
if csvDesc, ok := set[crdDescID(uDesc)]; !ok {
314314
newDescs = append(newDescs, uDesc)
315315
} else {
316316
newDescs = append(newDescs, csvDesc)

0 commit comments

Comments
 (0)