Skip to content

Commit 8eda284

Browse files
authored
Use the correct io.Writer for k0sctl kubeconfig output (#413)
Redirect the output of `k0sctl kubeconfig` to the `io.Writer` being used in `cli.App` instead of `fmt.Println()`. This fixes the usage of `k0sctl` as a module when configured with an `cli.App.Writer` other than `os.Stdout` Signed-off-by: Shane Jarych <[email protected]> Signed-off-by: Shane Jarych <[email protected]>
1 parent ad3bb37 commit 8eda284

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/kubeconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var kubeconfigCommand = &cli.Command{
4949
return err
5050
}
5151

52-
fmt.Println(c.Metadata.Kubeconfig)
52+
fmt.Fprintf(ctx.App.Writer, "%s\n", c.Metadata.Kubeconfig)
5353

5454
return nil
5555
},

0 commit comments

Comments
 (0)