Stop using the deprecated method CurrentGinkgoTestDescription
Besides, the using of method might lead to a `concurrent map writes` issue per the discussion here: https://github.com/onsi/ginkgo/issues/970 Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
@@ -488,10 +488,13 @@ type ClientConfigGetter func() (*restclient.Config, error)
|
||||
func LoadConfig() (config *restclient.Config, err error) {
|
||||
defer func() {
|
||||
if err == nil && config != nil {
|
||||
testDesc := ginkgo.CurrentGinkgoTestDescription()
|
||||
if len(testDesc.ComponentTexts) > 0 {
|
||||
componentTexts := strings.Join(testDesc.ComponentTexts, " ")
|
||||
config.UserAgent = fmt.Sprintf("%s -- %s", restclient.DefaultKubernetesUserAgent(), componentTexts)
|
||||
testDesc := ginkgo.CurrentSpecReport()
|
||||
if len(testDesc.ContainerHierarchyTexts) > 0 {
|
||||
testName := strings.Join(testDesc.ContainerHierarchyTexts, " ")
|
||||
if len(testDesc.LeafNodeText) > 0 {
|
||||
testName = testName + " " + testDesc.LeafNodeText
|
||||
}
|
||||
config.UserAgent = fmt.Sprintf("%s -- %s", restclient.DefaultKubernetesUserAgent(), testName)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
Reference in New Issue
Block a user