[MM-55739] Allow admins to pipe the output of mmctl websocket into JSON parser (#25545)

This commit is contained in:
Ben Schumacher 2023-11-27 12:45:32 +01:00 committed by GitHub
parent 3cc3e88a57
commit 0a38042d58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ package commands
import ( import (
"fmt" "fmt"
"os"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -31,7 +32,7 @@ func websocketCmdF(cmd *cobra.Command, args []string) error {
} }
c.Listen() c.Listen()
fmt.Println("Press CTRL+C to exit") fmt.Fprintln(os.Stderr, "Press CTRL+C to exit")
for { for {
event := <-c.EventChannel event := <-c.EventChannel
data, err := event.ToJSON() data, err := event.ToJSON()