integration-tests: remove unneeded post hook wait workaround
This commit is contained in:
@@ -42,7 +42,6 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
|
||||||
authauthenticator "k8s.io/apiserver/pkg/authentication/authenticator"
|
authauthenticator "k8s.io/apiserver/pkg/authentication/authenticator"
|
||||||
"k8s.io/apiserver/pkg/authentication/authenticatorfactory"
|
"k8s.io/apiserver/pkg/authentication/authenticatorfactory"
|
||||||
authenticatorunion "k8s.io/apiserver/pkg/authentication/request/union"
|
authenticatorunion "k8s.io/apiserver/pkg/authentication/request/union"
|
||||||
@@ -63,7 +62,6 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/apis/batch"
|
"k8s.io/kubernetes/pkg/apis/batch"
|
||||||
policy "k8s.io/kubernetes/pkg/apis/policy/v1alpha1"
|
policy "k8s.io/kubernetes/pkg/apis/policy/v1alpha1"
|
||||||
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
|
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
|
||||||
coreclient "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1"
|
|
||||||
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||||
informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"
|
informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"
|
||||||
"k8s.io/kubernetes/pkg/controller"
|
"k8s.io/kubernetes/pkg/controller"
|
||||||
@@ -289,30 +287,6 @@ func startMasterOrDie(masterConfig *master.Config, incomingServer *httptest.Serv
|
|||||||
glog.Fatal(err)
|
glog.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait for services to be ready
|
|
||||||
if masterConfig.EnableCoreControllers {
|
|
||||||
// TODO Once /healthz is updated for posthooks, we'll wait for good health
|
|
||||||
coreClient := coreclient.NewForConfigOrDie(&cfg)
|
|
||||||
svcWatch, err := coreClient.Services(metav1.NamespaceDefault).Watch(metav1.ListOptions{})
|
|
||||||
if err != nil {
|
|
||||||
closeFn()
|
|
||||||
glog.Fatal(err)
|
|
||||||
}
|
|
||||||
_, err = watch.Until(30*time.Second, svcWatch, func(event watch.Event) (bool, error) {
|
|
||||||
if event.Type != watch.Added {
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
if event.Object.(*v1.Service).Name == "kubernetes" {
|
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
return false, nil
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
closeFn()
|
|
||||||
glog.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return m, s, closeFn
|
return m, s, closeFn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,6 +94,16 @@ func TestExtensionsPrefix(t *testing.T) {
|
|||||||
testPrefix(t, "/apis/extensions/")
|
testPrefix(t, "/apis/extensions/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestKubernetesService(t *testing.T) {
|
||||||
|
config := framework.NewMasterConfig()
|
||||||
|
_, _, closeFn := framework.RunAMaster(config)
|
||||||
|
defer closeFn()
|
||||||
|
coreClient := clientset.NewForConfigOrDie(config.GenericConfig.LoopbackClientConfig)
|
||||||
|
if _, err := coreClient.Services(metav1.NamespaceDefault).Get("kubernetes", metav1.GetOptions{}); err != nil {
|
||||||
|
t.Fatalf("Expected kubernetes service to exists, got: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestEmptyList(t *testing.T) {
|
func TestEmptyList(t *testing.T) {
|
||||||
_, s, closeFn := framework.RunAMaster(nil)
|
_, s, closeFn := framework.RunAMaster(nil)
|
||||||
defer closeFn()
|
defer closeFn()
|
||||||
|
Reference in New Issue
Block a user