Skip to content

Commit 3631d4b

Browse files
committed
fix: revert separator, add claim crd conversion
1 parent 1112ec0 commit 3631d4b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

internal/parser/parser.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ func (p *Parser) Run(ctx context.Context, in io.Reader) error {
6767
return nil
6868
}
6969

70-
_, errNewLine := p.Output.Write([]byte("---\n"))
7170
err := p.Printer.PrintObj(obj, p.Output)
7271

73-
if err != nil || errNewLine != nil {
72+
if err != nil {
7473
p.Logger.Error(err, "failed to write manifests to output")
7574
return abort(err)
7675
}
@@ -141,6 +140,17 @@ func (p *Parser) handleResource(obj runtime.Object, gvk *schema.GroupVersionKind
141140
crd.Kind = "CustomResourceDefinition"
142141
crd.APIVersion = "apiextensions.k8s.io/v1"
143142
out <- crd
143+
144+
if xcrDefinition.Spec.ClaimNames.Kind != "" {
145+
crd, err := xcrd.ForCompositeResourceClaim(xcrDefinition)
146+
if err != nil {
147+
return err
148+
}
149+
150+
crd.Kind = "CustomResourceDefinition"
151+
crd.APIVersion = "apiextensions.k8s.io/v1"
152+
out <- crd
153+
}
144154
}
145155

146156
return nil

0 commit comments

Comments
 (0)