Esempio n. 1
0
// RunLegacyDiscoveryServer runs the legacy mode of discovery
func (o DiscoveryServerOptions) RunLegacyDiscoveryServer() error {
	configFilePath := "config.json"
	port := "9090"
	s, err := legacy.NewDiscoverySummarizer(configFilePath)
	if err != nil {
		return err
	}
	return s.Run(port)
}
func runDiscoverySummarizer(t *testing.T) string {
	configFilePath := "../../../cmd/kubernetes-discovery/config.json"
	port := "9090"
	serverURL := "http://localhost:" + port
	s, err := legacy.NewDiscoverySummarizer(configFilePath)
	if err != nil {
		t.Errorf("unexpected error: %v\n", err)
	}
	go func() {
		if err := s.Run(port); err != nil {
			t.Fatalf("error in bringing up the server: %v", err)
		}
	}()
	if err := waitForServerUp(serverURL); err != nil {
		t.Fatalf("%v", err)
	}
	return serverURL
}