Skip to content

Commit

Permalink
Merge pull request #150 from thetechnick/fix-missing-csv-header
Browse files Browse the repository at this point in the history
fix missing CSV type header
  • Loading branch information
openshift-merge-robot authored Mar 3, 2022
2 parents 964fb36 + 3fca5c3 commit 0cbcb55
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/mt-sre/devkube/magedeps"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
"sigs.k8s.io/yaml"
)

Expand Down Expand Up @@ -330,6 +331,13 @@ func (b Build) TemplateAddonOperatorCSV() error {
}
csv.Annotations["containerImage"] = imageURL("addon-operator-manager")

// Sets kind and apiGroup
gvk, err := apiutil.GVKForObject(&csv, scheme)
if err != nil {
return err
}
csv.SetGroupVersionKind(gvk)

// write
csvBytes, err := yaml.Marshal(csv)
if err != nil {
Expand Down

0 comments on commit 0cbcb55

Please sign in to comment.