diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index d470a477..e4000c05 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -6,7 +6,6 @@ package e2e import ( "context" "fmt" - "net/http" "time" . "github.com/onsi/ginkgo/v2" @@ -14,6 +13,7 @@ import ( "github.com/onsi/gomega/format" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/client-go/rest" "k8s.io/klog/v2" "k8s.io/kubectl/pkg/scheme" "sigs.k8s.io/cli-utils/test/e2e/e2eutil" @@ -68,7 +68,9 @@ var _ = BeforeSuite(func() { inventoryConfigs[ConfigMapTypeInvConfig] = invconfig.NewConfigMapTypeInvConfig(cfg) inventoryConfigs[CustomTypeInvConfig] = invconfig.NewCustomTypeInvConfig(cfg) - mapper, err := apiutil.NewDynamicRESTMapper(cfg, http.DefaultClient) + httpClient, err := rest.HTTPClientFor(cfg) + Expect(err).NotTo(HaveOccurred()) + mapper, err := apiutil.NewDynamicRESTMapper(cfg, httpClient) Expect(err).NotTo(HaveOccurred()) c, err = client.New(cfg, client.Options{ diff --git a/test/stress/stress_test.go b/test/stress/stress_test.go index de68b4a5..e7e1f675 100644 --- a/test/stress/stress_test.go +++ b/test/stress/stress_test.go @@ -5,13 +5,13 @@ package stress import ( "context" - "net/http" "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/format" v1 "k8s.io/api/core/v1" + "k8s.io/client-go/rest" "k8s.io/klog/v2" "k8s.io/kubectl/pkg/scheme" "sigs.k8s.io/cli-utils/test/e2e/e2eutil" @@ -55,7 +55,9 @@ var _ = BeforeSuite(func() { invConfig = invconfig.NewCustomTypeInvConfig(cfg) - mapper, err := apiutil.NewDynamicRESTMapper(cfg, http.DefaultClient) + httpClient, err := rest.HTTPClientFor(cfg) + Expect(err).NotTo(HaveOccurred()) + mapper, err := apiutil.NewDynamicRESTMapper(cfg, httpClient) Expect(err).NotTo(HaveOccurred()) c, err = client.New(cfg, client.Options{