Documentation
¶
Index ¶
Constants ¶
View Source
const ( NamespacesKey = "namespaces" NamespacesShorthand = "n" )
Variables ¶
View Source
var ListCmd = &cobra.Command{ Use: "list", Short: "List intents discovered by the network mapper", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return mapperclient.WithClient(func(c *mapperclient.Client) error { namespacesFilter := viper.GetStringSlice(NamespacesKey) servicesIntents, err := c.ServiceIntents(context.Background(), namespacesFilter) if err != nil { return err } for _, service := range servicesIntents { output.PrintStdout("%s in namespace %s calls:", service.Client.Name, service.Client.Namespace) for _, intent := range service.Intents { if len(intent.Namespace) != 0 { output.PrintStdout(" - %s in namespace %s", intent.Name, intent.Namespace) continue } output.PrintStdout(" - %s", intent.Name) } } if len(servicesIntents) == 0 { output.PrintStderr("No connections found. The network mapper detects (1) connections that are currently open and (2) DNS lookups while a connection is being initiated, for connections between pods on this cluster.") } return nil }) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.