diff --git a/changelog/fragments/get-csv-manifest-bugfix.yaml b/changelog/fragments/get-csv-manifest-bugfix.yaml new file mode 100644 index 00000000000..fff55d95aee --- /dev/null +++ b/changelog/fragments/get-csv-manifest-bugfix.yaml @@ -0,0 +1,9 @@ +# entries is a list of entries to include in +# release notes and/or the migration guide +entries: + - description: > + CSV manifests read from disk are now properly marshaled into the CSV struct + + kind: "bugfix" + + breaking: false diff --git a/internal/generate/olm-catalog/csv_util.go b/internal/generate/olm-catalog/csv_util.go index 0d96a0eeecb..101cf4ec197 100644 --- a/internal/generate/olm-catalog/csv_util.go +++ b/internal/generate/olm-catalog/csv_util.go @@ -114,7 +114,7 @@ func getCSVFromDir(dir string) (*olmapiv1alpha1.ClusterServiceVersion, error) { } if typeMeta.Kind == olmapiv1alpha1.ClusterServiceVersionKind { csv := &olmapiv1alpha1.ClusterServiceVersion{} - if err := yaml.Unmarshal(b, csv); err != nil { + if err := yaml.Unmarshal(manifest, csv); err != nil { return nil, fmt.Errorf("error unmarshalling ClusterServiceVersion from manifest %s: %v", path, err) } return csv, nil