Esempio n. 1
0
func main() {
	serverRunOptions := apiserver.NewServerRunOptions()

	// Parse command line flags.
	serverRunOptions.AddFlags(pflag.CommandLine)
	flag.InitFlags()

	if err := apiserver.Run(serverRunOptions); err != nil {
		glog.Fatalf("Error in bringing up the server: %v", err)
	}
}
Esempio n. 2
0
func main() {
	serverRunOptions := apiserver.NewServerRunOptions()

	// Parse command line flags.
	serverRunOptions.AddUniversalFlags(pflag.CommandLine)
	serverRunOptions.AddEtcdStorageFlags(pflag.CommandLine)
	flag.InitFlags()

	if err := apiserver.Run(serverRunOptions, wait.NeverStop); err != nil {
		glog.Fatalf("Error in bringing up the server: %v", err)
	}
}
Esempio n. 3
0
func TestRun(t *testing.T) {
	go func() {
		if err := apiserver.Run(apiserver.NewServerRunOptions()); err != nil {
			t.Fatalf("Error in bringing up the server: %v", err)
		}
	}()
	if err := waitForApiserverUp(); err != nil {
		t.Fatalf("%v", err)
	}
	testSwaggerSpec(t)
	testAPIGroupList(t)
	testAPIGroup(t)
	testAPIResourceList(t)
}
Esempio n. 4
0
func main() {
	serverRunOptions := apiserver.NewServerRunOptions()

	// Parse command line flags.
	serverRunOptions.GenericServerRunOptions.AddUniversalFlags(pflag.CommandLine)
	serverRunOptions.Etcd.AddFlags(pflag.CommandLine)
	serverRunOptions.SecureServing.AddFlags(pflag.CommandLine)
	serverRunOptions.SecureServing.AddDeprecatedFlags(pflag.CommandLine)
	serverRunOptions.InsecureServing.AddFlags(pflag.CommandLine)
	serverRunOptions.InsecureServing.AddDeprecatedFlags(pflag.CommandLine)
	flag.InitFlags()

	if err := serverRunOptions.Run(wait.NeverStop); err != nil {
		glog.Fatalf("Error in bringing up the server: %v", err)
	}
}
func runAPIServer(t *testing.T) string {
	serverRunOptions := apiserver.NewServerRunOptions()
	// Change the port, because otherwise it will fail if examples/apiserver/apiserver_test and this are run in parallel.
	serverRunOptions.InsecurePort = 8083
	go func() {
		if err := apiserver.Run(serverRunOptions); err != nil {
			t.Fatalf("Error in bringing up the example apiserver: %v", err)
		}
	}()

	serverURL := fmt.Sprintf("http://localhost:%d", serverRunOptions.InsecurePort)
	if err := waitForServerUp(serverURL); err != nil {
		t.Fatalf("%v", err)
	}
	return serverURL
}
Esempio n. 6
0
func TestRunServer(t *testing.T) {
	serverIP := fmt.Sprintf("http://localhost:%d", apiserver.InsecurePort)
	stopCh := make(chan struct{})
	go func() {
		if err := apiserver.NewServerRunOptions().Run(stopCh); err != nil {
			t.Fatalf("Error in bringing up the server: %v", err)
		}
	}()
	defer close(stopCh)
	if err := waitForApiserverUp(serverIP); err != nil {
		t.Fatalf("%v", err)
	}
	testSwaggerSpec(t, serverIP)
	testAPIGroupList(t, serverIP)
	testAPIGroup(t, serverIP)
	testAPIResourceList(t, serverIP)
}