Remove k8s.io/kubernetes dependency
This commit is contained in:
parent
a762d8a4e3
commit
a85e53f4cb
8 changed files with 86 additions and 234 deletions
|
|
@ -42,8 +42,6 @@ import (
|
|||
restclient "k8s.io/client-go/rest"
|
||||
"k8s.io/ingress-nginx/internal/k8s"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/kubernetes/pkg/apis/core"
|
||||
kubeframework "k8s.io/kubernetes/test/e2e/framework"
|
||||
)
|
||||
|
||||
// RequestScheme define a scheme used in a test request.
|
||||
|
|
@ -97,7 +95,7 @@ func (f *Framework) BeforeEach() {
|
|||
var err error
|
||||
|
||||
if f.KubeClientSet == nil {
|
||||
f.KubeConfig, err = kubeframework.LoadConfig()
|
||||
f.KubeConfig, err = loadConfig()
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "loading a kubernetes client configuration")
|
||||
|
||||
// TODO: remove after k8s v1.22
|
||||
|
|
@ -392,7 +390,7 @@ func getReloadCount(pod *corev1.Pod, namespace string, client kubernetes.Interfa
|
|||
|
||||
reloadCount := 0
|
||||
for _, e := range evnts.Items {
|
||||
if e.Reason == "RELOAD" && e.Type == core.EventTypeNormal {
|
||||
if e.Reason == "RELOAD" && e.Type == corev1.EventTypeNormal {
|
||||
reloadCount++
|
||||
}
|
||||
}
|
||||
|
|
@ -717,3 +715,13 @@ func Sleep(duration ...time.Duration) {
|
|||
|
||||
time.Sleep(sleepFor)
|
||||
}
|
||||
|
||||
func loadConfig() (*restclient.Config, error) {
|
||||
config, err := rest.InClusterConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
config.UserAgent = "ingress-nginx-e2e"
|
||||
return config, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue