Ejemplo n.º 1
0
// NewProber creates a Prober, it takes a command runner and
// several container info managers.
func newProber(
	runner kubecontainer.ContainerCommandRunner,
	refManager *kubecontainer.RefManager,
	recorder record.EventRecorder) *prober {

	return &prober{
		exec:       execprobe.New(),
		http:       httprobe.New(),
		tcp:        tcprobe.New(),
		runner:     runner,
		refManager: refManager,
		recorder:   recorder,
	}
}
Ejemplo n.º 2
0
func healthzProxyTest(masterConfig *configapi.MasterConfig, t *testing.T) {
	// Ping the healthz endpoint on the second OpenShift cluster
	url, err := url.Parse(masterConfig.MasterPublicURL)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	url.Path = "/healthz"
	response, body, err := httpprobe.New().Probe(url, 1*time.Second)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	if response != probe.Success {
		t.Fatalf("Server reported unhealthy: %v", body)
	}
}
Ejemplo n.º 3
0
Archivo: rest.go Proyecto: 40a/bootkube
// NewStorage returns a new REST.
func NewStorage(serverRetriever func() map[string]apiserver.Server) *REST {
	return &REST{
		GetServersToValidate: serverRetriever,
		prober:               httpprober.New(),
	}
}