Skip to content

Commit 5bfe311

Browse files
joelanfordjmrodri
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
1 parent 070d931 commit 5bfe311

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
- In the Helm operator, skip owner reference injection for cluster-scoped resources in release manifests. The Helm operator only supports namespace-scoped CRs, and namespaced resources cannot own cluster-scoped resources. ([#1817](https://github.com/operator-framework/operator-sdk/pull/1817))
7070
- Package manifests generated with [`gen-csv`](https://github.com/operator-framework/operator-sdk/blob/master/doc/sdk-cli-reference.md#gen-csv) respect the `--operator-name` flag, channel names are checked for duplicates before (re-)generation. ([#1693](https://github.com/operator-framework/operator-sdk/pull/1693))
7171
- Generated inventory for Ansible-based Operators now sets the localhost's `ansible_python_interpreter` to `{{ ansible_playbook_python }}`, to properly match the [implicit localhost](https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html). ([#1952](https://github.com/operator-framework/operator-sdk/pull/1952))
72+
- 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))
7273
7374
## v0.10.0
7475

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)