Skip to content

Commit

Permalink
fix missing CSV type header
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Schieder <[email protected]>
  • Loading branch information
thetechnick committed Mar 3, 2022
1 parent 964fb36 commit 3fca5c3
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 3fca5c3

Please sign in to comment.