Skip to content

Commit 9967f45

Browse files
authored
Merge pull request crossplane#6142 from recht/kongout
2 parents 99ac82d + f0240b5 commit 9967f45

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd/crank/render/cmd.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package render
2020
import (
2121
"context"
2222
"fmt"
23-
"os"
2423
"time"
2524

2625
"github.com/alecthomas/kong"
@@ -251,29 +250,29 @@ func (c *Cmd) Run(k *kong.Context, log logging.Logger) error { //nolint:gocognit
251250
}
252251

253252
_, _ = fmt.Fprintln(k.Stdout, "---")
254-
if err := s.Encode(out.CompositeResource, os.Stdout); err != nil {
253+
if err := s.Encode(out.CompositeResource, k.Stdout); err != nil {
255254
return errors.Wrapf(err, "cannot marshal composite resource %q to YAML", xr.GetName())
256255
}
257256

258257
for i := range out.ComposedResources {
259258
_, _ = fmt.Fprintln(k.Stdout, "---")
260-
if err := s.Encode(&out.ComposedResources[i], os.Stdout); err != nil {
259+
if err := s.Encode(&out.ComposedResources[i], k.Stdout); err != nil {
261260
return errors.Wrapf(err, "cannot marshal composed resource %q to YAML", out.ComposedResources[i].GetAnnotations()[AnnotationKeyCompositionResourceName])
262261
}
263262
}
264263

265264
if c.IncludeFunctionResults {
266265
for i := range out.Results {
267266
_, _ = fmt.Fprintln(k.Stdout, "---")
268-
if err := s.Encode(&out.Results[i], os.Stdout); err != nil {
267+
if err := s.Encode(&out.Results[i], k.Stdout); err != nil {
269268
return errors.Wrap(err, "cannot marshal result to YAML")
270269
}
271270
}
272271
}
273272

274273
if c.IncludeContext {
275274
_, _ = fmt.Fprintln(k.Stdout, "---")
276-
if err := s.Encode(out.Context, os.Stdout); err != nil {
275+
if err := s.Encode(out.Context, k.Stdout); err != nil {
277276
return errors.Wrap(err, "cannot marshal context to YAML")
278277
}
279278
}

0 commit comments

Comments
 (0)