Add Test Description to e2e User-Agent

Co-Authored-By: Guinevere Saenger <guineveresaenger@gmail.com>
This commit is contained in:
Hippie Hacker 2018-08-18 10:38:19 +12:00
parent 09cdfc5287
commit 229ecedac5

View File

@ -155,6 +155,15 @@ func (f *Framework) BeforeEach() {
if f.ClientSet == nil {
By("Creating a kubernetes client")
config, err := LoadConfig()
testDesc := CurrentGinkgoTestDescription()
if len(testDesc.ComponentTexts) > 0 {
componentTexts := strings.Join(testDesc.ComponentTexts, " ")
config.UserAgent = fmt.Sprintf(
"%v -- %v",
rest.DefaultKubernetesUserAgent(),
componentTexts)
}
Expect(err).NotTo(HaveOccurred())
config.QPS = f.Options.ClientQPS
config.Burst = f.Options.ClientBurst