dbg

package
v1.15.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = func() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "clustermesh-dbg",
		Short: "CLI for interacting with ClusterMesh",

		PersistentPreRun: func(cmd *cobra.Command, args []string) {
			ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt)
			cmd.SetContext(ctx)
		},
	}

	return cmd
}()
View Source
var Troubleshoot = func() *cobra.Command {
	var etcdcfg string
	var timeout time.Duration

	cmd := &cobra.Command{
		Use:   "troubleshoot",
		Short: "Troubleshoot connectivity towards the local etcd kvstore",
		Run: func(cmd *cobra.Command, args []string) {
			stdout := cmd.OutOrStdout()

			fmt.Fprintf(stdout, "Local etcd kvstore:\n")
			cctx, cancel := context.WithTimeout(cmd.Context(), timeout)
			kvstore.EtcdDbg(cctx, etcdcfg, kvstore.DefaultEtcdDbgDialer{}, stdout)
			cancel()
		},
	}

	RootCmd.AddCommand(cmd)

	flags := cmd.Flags()
	flags.StringVar(&etcdcfg, "etcd-config", "/var/lib/cilium/etcd-config.yaml", "Path to the etcd configuration")
	flags.DurationVar(&timeout, "timeout", 5*time.Second, "Timeout when checking connectivity to the etcd kvstore")

	return cmd
}()

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL