add healthz to genericapiserver
This commit is contained in:
@@ -475,4 +475,10 @@ func TestBootstrapping(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Errorf("missing cluster-admin: %v", clusterRoles)
|
||||
|
||||
healthBytes, err := clientset.Discovery().RESTClient().Get().AbsPath("/healthz/poststarthooks/rbac/bootstrap-roles").DoRaw()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
t.Errorf("expected %v, got %v", "asdf", string(healthBytes))
|
||||
}
|
||||
|
@@ -235,6 +235,12 @@ func startMasterOrDie(masterConfig *master.Config, incomingServer *httptest.Serv
|
||||
masterReceiver.SetMaster(m)
|
||||
}
|
||||
|
||||
// TODO have this start method actually use the normal start sequence for the API server
|
||||
// this method never actually calls the `Run` method for the API server
|
||||
// fire the post hooks ourselves
|
||||
m.GenericAPIServer.PrepareRun()
|
||||
m.GenericAPIServer.RunPostStartHooks()
|
||||
|
||||
cfg := *masterConfig.GenericConfig.LoopbackClientConfig
|
||||
cfg.ContentConfig.GroupVersion = &unversioned.GroupVersion{}
|
||||
privilegedClient, err := restclient.RESTClientFor(&cfg)
|
||||
@@ -254,12 +260,6 @@ func startMasterOrDie(masterConfig *master.Config, incomingServer *httptest.Serv
|
||||
glog.Fatal(err)
|
||||
}
|
||||
|
||||
// TODO have this start method actually use the normal start sequence for the API server
|
||||
// this method never actually calls the `Run` method for the API server
|
||||
// fire the post hooks ourselves
|
||||
m.GenericAPIServer.PrepareRun()
|
||||
m.GenericAPIServer.RunPostStartHooks()
|
||||
|
||||
// wait for services to be ready
|
||||
if masterConfig.EnableCoreControllers {
|
||||
// TODO Once /healthz is updated for posthooks, we'll wait for good health
|
||||
@@ -350,6 +350,7 @@ func NewMasterConfig() *master.Config {
|
||||
genericConfig.APIResourceConfigSource = master.DefaultAPIResourceConfigSource()
|
||||
genericConfig.Authorizer = authorizer.NewAlwaysAllowAuthorizer()
|
||||
genericConfig.AdmissionControl = admit.NewAlwaysAdmit()
|
||||
genericConfig.EnableMetrics = true
|
||||
|
||||
return &master.Config{
|
||||
GenericConfig: genericConfig,
|
||||
|
@@ -29,6 +29,7 @@ func TestMasterExportsSymbols(t *testing.T) {
|
||||
_ = &master.Config{
|
||||
GenericConfig: &genericapiserver.Config{
|
||||
EnableSwaggerSupport: false,
|
||||
EnableMetrics: true,
|
||||
},
|
||||
EnableCoreControllers: false,
|
||||
EnableUISupport: false,
|
||||
|
Reference in New Issue
Block a user