seed

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SeedCmd = &cobra.Command{
	Use:          "seed",
	Short:        "Skydive seed",
	Long:         "Skydive seed [probe1] [probe2] ...",
	SilenceUsage: true,
	Run: func(cmd *cobra.Command, args []string) {
		config.Set("logging.id", "seed")
		logging.GetLogger().Noticef("Skydive Seed %s starting...", version.Version)

		memory, err := graph.NewMemoryBackend()
		if err != nil {
			logging.GetLogger().Errorf("Failed to start seed: %s", err)
			os.Exit(1)
		}

		hostID := config.GetString("host_id")
		if hostID == "" {
			logging.GetLogger().Errorf("Failed to determine host id for seed")
			os.Exit(1)
		}

		g := graph.NewGraph(hostID, memory, common.UnknownService)

		probeBundle = probe.NewBundle()
		seed, err := seed.NewSeed(g, common.SeedService, agentAddr, subscriberFilter, &authenticationOpts, logging.GetLogger())
		if err != nil {
			logging.GetLogger().Errorf("Failed to start seed: %s", err)
			os.Exit(1)
		}
		seed.AddEventHandler(&seedHandler{g: g, probes: args})
		seed.Start()

		logging.GetLogger().Notice("Skydive seed started")
		ch := make(chan os.Signal)
		signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
		<-ch

		probeBundle.Stop()
		seed.Stop()

		logging.GetLogger().Notice("Skydive seed stopped.")
	},
}

SeedCmd describe the skydive seed root command

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