Skip to content

Commit 10486a7

Browse files
authored
Merge pull request kubernetes#110707 from wongearl/fix-package-importe
fix "k8s.io/client-go/rest" is being imported more than once,optimize code
2 parents 3beb8dc + 44404d3 commit 10486a7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/e2e/framework/util.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import (
5353
utilfeature "k8s.io/apiserver/pkg/util/feature"
5454
"k8s.io/client-go/dynamic"
5555
clientset "k8s.io/client-go/kubernetes"
56-
"k8s.io/client-go/rest"
5756
restclient "k8s.io/client-go/rest"
5857
"k8s.io/client-go/tools/cache"
5958
"k8s.io/client-go/tools/clientcmd"
@@ -492,7 +491,7 @@ func LoadConfig() (config *restclient.Config, err error) {
492491
testDesc := ginkgo.CurrentGinkgoTestDescription()
493492
if len(testDesc.ComponentTexts) > 0 {
494493
componentTexts := strings.Join(testDesc.ComponentTexts, " ")
495-
config.UserAgent = fmt.Sprintf("%s -- %s", rest.DefaultKubernetesUserAgent(), componentTexts)
494+
config.UserAgent = fmt.Sprintf("%s -- %s", restclient.DefaultKubernetesUserAgent(), componentTexts)
496495
}
497496
}
498497
}()
@@ -1357,7 +1356,7 @@ func PrettyPrintJSON(metrics interface{}) string {
13571356
Logf("Error indenting: %v", err)
13581357
return ""
13591358
}
1360-
return string(formatted.Bytes())
1359+
return formatted.String()
13611360
}
13621361

13631362
// taintExists checks if the given taint exists in list of taints. Returns true if exists false otherwise.
@@ -1422,7 +1421,7 @@ retriesLoop:
14221421
break actualWatchEventsLoop
14231422
}
14241423
}
1425-
if foundExpectedWatchEvent == false {
1424+
if !foundExpectedWatchEvent {
14261425
errs.Insert(fmt.Sprintf("Watch event %v not found", expectedWatchEvent.Type))
14271426
}
14281427
totalValidWatchEvents++

0 commit comments

Comments
 (0)