[MM-55739] Allow admins to pipe the output of mmctl websocket into JSON parser (#25545)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3cc3e88a57
Коммит
0a38042d58
@@ -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()
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user