Skip to content

Commit

Permalink
fix: write yaml separator before manifsts
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed Jan 19, 2024
1 parent 803cc28 commit 41598d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ func (p *Parser) Run(ctx context.Context, in io.Reader) error {
return nil
}

_, errNewLine := p.Output.Write([]byte("---\n"))
err := p.Printer.PrintObj(obj, p.Output)
if err != nil {

if err != nil || errNewLine != nil {
p.Logger.Error(err, "failed to write manifests to output")
return abort(err)
}
Expand Down Expand Up @@ -205,6 +207,10 @@ func (p *Parser) unpack(pkg *crossplanev1.Provider) ([]byte, error) {
}

layers, err := ociImage.Layers()
if err != nil {
return nil, err
}

for _, layer := range layers {
contents, err := layer.Uncompressed()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/xcrd/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/meta"
Expand Down Expand Up @@ -130,7 +130,7 @@ func genCrdVersion(vr v1.CompositeResourceDefinitionVersion) (*extv1.CustomResou
Name: vr.Name,
Served: vr.Served,
Storage: vr.Referenceable,
Deprecated: pointer.BoolDeref(vr.Deprecated, false),
Deprecated: ptr.Deref(vr.Deprecated, false),
DeprecationWarning: vr.DeprecationWarning,
AdditionalPrinterColumns: vr.AdditionalPrinterColumns,
Schema: &extv1.CustomResourceValidation{
Expand Down

0 comments on commit 41598d8

Please sign in to comment.