From f4ffca8e8ba7de2f131d236dd129a488f71a9b1d Mon Sep 17 00:00:00 2001 From: SataQiu <1527062125@qq.com> Date: Thu, 7 Nov 2019 11:18:58 +0800 Subject: [PATCH] e2e: remove unused KubectlVersion function from framework/util --- test/e2e/framework/util.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 74504d1056d..a8e531130d6 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -56,7 +56,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/uuid" - utilversion "k8s.io/apimachinery/pkg/util/version" "k8s.io/apimachinery/pkg/util/wait" utilyaml "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/apimachinery/pkg/watch" @@ -183,9 +182,6 @@ var ( // AgnHostImage is the image URI of AgnHost AgnHostImage = imageutils.GetE2EImage(imageutils.Agnhost) - // For parsing Kubectl version for version-skewed testing. - gitVersionRegexp = regexp.MustCompile("GitVersion:\"(v.+?)\"") - // ProvidersWithSSH are those providers where each node is accessible with SSH ProvidersWithSSH = []string{"gce", "gke", "aws", "local"} @@ -746,19 +742,6 @@ func countEndpointsNum(e *v1.Endpoints) int { return num } -// KubectlVersion gets the version of kubectl that's currently being used (see -// --kubectl-path in e2e.go to use an alternate kubectl). -func KubectlVersion() (*utilversion.Version, error) { - output := RunKubectlOrDie("version", "--client") - matches := gitVersionRegexp.FindStringSubmatch(output) - if len(matches) != 2 { - return nil, fmt.Errorf("Could not find kubectl version in output %v", output) - } - // Don't use the full match, as it contains "GitVersion:\"" and a - // trailing "\"". Just use the submatch. - return utilversion.ParseSemantic(matches[1]) -} - // restclientConfig returns a config holds the information needed to build connection to kubernetes clusters. func restclientConfig(kubeContext string) (*clientcmdapi.Config, error) { Logf(">>> kubeConfig: %s", TestContext.KubeConfig)