MCPcopy
hub / github.com/cilium/cilium / New

Function New

hubble/cmd/list/list.go:23–38  ·  view source on GitHub ↗

New creates a new list command.

(vp *viper.Viper)

Source from the content-addressed store, hash-verified

21
22// New creates a new list command.
23func New(vp *viper.Viper) *cobra.Command {
24 listCmd := &cobra.Command{
25 Use: "list",
26 Short: "List Hubble objects",
27 }
28
29 // add config.ServerFlags to the help template as these flags are used by
30 // this command
31 template.RegisterFlagSets(listCmd, config.ServerFlags)
32
33 listCmd.AddCommand(
34 newNodeCommand(vp),
35 newNamespacesCommand(vp),
36 )
37 return listCmd
38}
39
40func jsonOutput(buf io.Writer, v any) error {
41 bs, err := json.MarshalIndent(v, "", " ")

Callers 1

NewWithViperFunction · 0.92

Calls 3

RegisterFlagSetsFunction · 0.92
newNodeCommandFunction · 0.85
newNamespacesCommandFunction · 0.85

Tested by

no test coverage detected