Skip to content

Commit

Permalink
fix: revert separator, add claim crd conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed Jan 19, 2024
1 parent 1112ec0 commit 3631d4b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ 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 || errNewLine != nil {
if err != nil {
p.Logger.Error(err, "failed to write manifests to output")
return abort(err)
}
Expand Down Expand Up @@ -141,6 +140,17 @@ func (p *Parser) handleResource(obj runtime.Object, gvk *schema.GroupVersionKind
crd.Kind = "CustomResourceDefinition"
crd.APIVersion = "apiextensions.k8s.io/v1"
out <- crd

if xcrDefinition.Spec.ClaimNames.Kind != "" {
crd, err := xcrd.ForCompositeResourceClaim(xcrDefinition)
if err != nil {
return err
}

crd.Kind = "CustomResourceDefinition"
crd.APIVersion = "apiextensions.k8s.io/v1"
out <- crd
}
}

return nil
Expand Down

0 comments on commit 3631d4b

Please sign in to comment.