mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Merge pull request #75989 from neolit123/remove-aggregator-from-e2e-fw
[e2e] decouple the aggregated clientset from the e2e testing framework
This commit is contained in:
commit
92e087c402
@ -25,7 +25,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
apps "k8s.io/api/apps/v1"
|
apps "k8s.io/api/apps/v1"
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||||
apierrs "k8s.io/apimachinery/pkg/api/errors"
|
apierrs "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -74,7 +74,17 @@ var _ = SIGDescribe("Aggregator", func() {
|
|||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
c = f.ClientSet
|
c = f.ClientSet
|
||||||
ns = f.Namespace.Name
|
ns = f.Namespace.Name
|
||||||
aggrclient = f.AggregatorClient
|
|
||||||
|
if aggrclient == nil {
|
||||||
|
config, err := framework.LoadConfig()
|
||||||
|
if err != nil {
|
||||||
|
framework.Failf("could not load config: %v", err)
|
||||||
|
}
|
||||||
|
aggrclient, err = aggregatorclient.NewForConfig(config)
|
||||||
|
if err != nil {
|
||||||
|
framework.Failf("could not create aggregator client: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -84,7 +94,7 @@ var _ = SIGDescribe("Aggregator", func() {
|
|||||||
*/
|
*/
|
||||||
framework.ConformanceIt("Should be able to support the 1.10 Sample API Server using the current Aggregator", func() {
|
framework.ConformanceIt("Should be able to support the 1.10 Sample API Server using the current Aggregator", func() {
|
||||||
// Testing a 1.10 version of the sample-apiserver
|
// Testing a 1.10 version of the sample-apiserver
|
||||||
TestSampleAPIServer(f, imageutils.GetE2EImage(imageutils.APIServer))
|
TestSampleAPIServer(f, aggrclient, imageutils.GetE2EImage(imageutils.APIServer))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -104,11 +114,10 @@ func cleanTest(client clientset.Interface, aggrclient *aggregatorclient.Clientse
|
|||||||
|
|
||||||
// TestSampleAPIServer is a basic test if the sample-apiserver code from 1.10 and compiled against 1.10
|
// TestSampleAPIServer is a basic test if the sample-apiserver code from 1.10 and compiled against 1.10
|
||||||
// will work on the current Aggregator/API-Server.
|
// will work on the current Aggregator/API-Server.
|
||||||
func TestSampleAPIServer(f *framework.Framework, image string) {
|
func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Clientset, image string) {
|
||||||
ginkgo.By("Registering the sample API server.")
|
ginkgo.By("Registering the sample API server.")
|
||||||
client := f.ClientSet
|
client := f.ClientSet
|
||||||
restClient := client.Discovery().RESTClient()
|
restClient := client.Discovery().RESTClient()
|
||||||
aggrclient := f.AggregatorClient
|
|
||||||
|
|
||||||
namespace := f.Namespace.Name
|
namespace := f.Namespace.Name
|
||||||
context := setupServerCert(namespace, "sample-api")
|
context := setupServerCert(namespace, "sample-api")
|
||||||
|
@ -116,7 +116,6 @@ go_library(
|
|||||||
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
|
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/util/retry:go_default_library",
|
"//staging/src/k8s.io/client-go/util/retry:go_default_library",
|
||||||
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
|
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
|
||||||
"//staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset:go_default_library",
|
|
||||||
"//test/e2e/framework/ginkgowrapper:go_default_library",
|
"//test/e2e/framework/ginkgowrapper:go_default_library",
|
||||||
"//test/e2e/framework/metrics:go_default_library",
|
"//test/e2e/framework/metrics:go_default_library",
|
||||||
"//test/e2e/framework/testfiles:go_default_library",
|
"//test/e2e/framework/testfiles:go_default_library",
|
||||||
|
@ -46,7 +46,6 @@ import (
|
|||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
"k8s.io/client-go/restmapper"
|
"k8s.io/client-go/restmapper"
|
||||||
scaleclient "k8s.io/client-go/scale"
|
scaleclient "k8s.io/client-go/scale"
|
||||||
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
|
|
||||||
"k8s.io/kubernetes/test/e2e/framework/metrics"
|
"k8s.io/kubernetes/test/e2e/framework/metrics"
|
||||||
testutils "k8s.io/kubernetes/test/utils"
|
testutils "k8s.io/kubernetes/test/utils"
|
||||||
|
|
||||||
@ -75,8 +74,7 @@ type Framework struct {
|
|||||||
ClientSet clientset.Interface
|
ClientSet clientset.Interface
|
||||||
KubemarkExternalClusterClientSet clientset.Interface
|
KubemarkExternalClusterClientSet clientset.Interface
|
||||||
|
|
||||||
AggregatorClient *aggregatorclient.Clientset
|
DynamicClient dynamic.Interface
|
||||||
DynamicClient dynamic.Interface
|
|
||||||
|
|
||||||
ScalesGetter scaleclient.ScalesGetter
|
ScalesGetter scaleclient.ScalesGetter
|
||||||
|
|
||||||
@ -182,8 +180,6 @@ func (f *Framework) BeforeEach() {
|
|||||||
}
|
}
|
||||||
f.ClientSet, err = clientset.NewForConfig(config)
|
f.ClientSet, err = clientset.NewForConfig(config)
|
||||||
ExpectNoError(err)
|
ExpectNoError(err)
|
||||||
f.AggregatorClient, err = aggregatorclient.NewForConfig(config)
|
|
||||||
ExpectNoError(err)
|
|
||||||
f.DynamicClient, err = dynamic.NewForConfig(config)
|
f.DynamicClient, err = dynamic.NewForConfig(config)
|
||||||
ExpectNoError(err)
|
ExpectNoError(err)
|
||||||
// node.k8s.io is based on CRD, which is served only as JSON
|
// node.k8s.io is based on CRD, which is served only as JSON
|
||||||
|
Loading…
Reference in New Issue
Block a user