@@ -33,7 +33,6 @@ import (
33
33
"k8s.io/apimachinery/pkg/util/wait"
34
34
clientset "k8s.io/client-go/kubernetes"
35
35
"k8s.io/kubernetes/test/e2e/framework"
36
- e2elog "k8s.io/kubernetes/test/e2e/framework/log"
37
36
imageutils "k8s.io/kubernetes/test/utils/image"
38
37
39
38
"github.com/onsi/ginkgo"
@@ -73,7 +72,7 @@ func (t *dnsTestCommon) init() {
73
72
gomega .Expect (len (pods .Items )).Should (gomega .BeNumerically (">=" , 1 ))
74
73
75
74
t .dnsPod = & pods .Items [0 ]
76
- e2elog .Logf ("Using DNS pod: %v" , t .dnsPod .Name )
75
+ framework .Logf ("Using DNS pod: %v" , t .dnsPod .Name )
77
76
78
77
if strings .Contains (t .dnsPod .Name , "coredns" ) {
79
78
t .name = "coredns"
@@ -101,7 +100,7 @@ func (t *dnsTestCommon) checkDNSRecordFrom(name string, predicate func([]string)
101
100
})
102
101
103
102
if err != nil {
104
- e2elog .Failf ("dig result did not match: %#v after %v" ,
103
+ framework .Failf ("dig result did not match: %#v after %v" ,
105
104
actual , timeout )
106
105
}
107
106
}
@@ -134,7 +133,7 @@ func (t *dnsTestCommon) runDig(dnsName, target string) []string {
134
133
CaptureStderr : true ,
135
134
})
136
135
137
- e2elog .Logf ("Running dig: %v, stdout: %q, stderr: %q, err: %v" ,
136
+ framework .Logf ("Running dig: %v, stdout: %q, stderr: %q, err: %v" ,
138
137
cmd , stdout , stderr , err )
139
138
140
139
if stdout == "" {
@@ -226,7 +225,7 @@ func (t *dnsTestCommon) createUtilPodLabel(baseName string) {
226
225
var err error
227
226
t .utilPod , err = t .c .CoreV1 ().Pods (t .f .Namespace .Name ).Create (t .utilPod )
228
227
framework .ExpectNoError (err , "failed to create pod: %v" , t .utilPod )
229
- e2elog .Logf ("Created pod %v" , t .utilPod )
228
+ framework .Logf ("Created pod %v" , t .utilPod )
230
229
err = t .f .WaitForPodRunning (t .utilPod .Name )
231
230
framework .ExpectNoError (err , "pod failed to start running: %v" , t .utilPod )
232
231
@@ -252,13 +251,13 @@ func (t *dnsTestCommon) createUtilPodLabel(baseName string) {
252
251
253
252
t .utilService , err = t .c .CoreV1 ().Services (t .f .Namespace .Name ).Create (t .utilService )
254
253
framework .ExpectNoError (err , "failed to create service: %s/%s" , t .f .Namespace .Name , t .utilService .ObjectMeta .Name )
255
- e2elog .Logf ("Created service %v" , t .utilService )
254
+ framework .Logf ("Created service %v" , t .utilService )
256
255
}
257
256
258
257
func (t * dnsTestCommon ) deleteUtilPod () {
259
258
podClient := t .c .CoreV1 ().Pods (t .f .Namespace .Name )
260
259
if err := podClient .Delete (t .utilPod .Name , metav1 .NewDeleteOptions (0 )); err != nil {
261
- e2elog .Logf ("Delete of pod %v/%v failed: %v" ,
260
+ framework .Logf ("Delete of pod %v/%v failed: %v" ,
262
261
t .utilPod .Namespace , t .utilPod .Name , err )
263
262
}
264
263
}
@@ -318,7 +317,7 @@ func (t *dnsTestCommon) createDNSPodFromObj(pod *v1.Pod) {
318
317
var err error
319
318
t .dnsServerPod , err = t .c .CoreV1 ().Pods (t .f .Namespace .Name ).Create (t .dnsServerPod )
320
319
framework .ExpectNoError (err , "failed to create pod: %v" , t .dnsServerPod )
321
- e2elog .Logf ("Created pod %v" , t .dnsServerPod )
320
+ framework .Logf ("Created pod %v" , t .dnsServerPod )
322
321
err = t .f .WaitForPodRunning (t .dnsServerPod .Name )
323
322
framework .ExpectNoError (err , "pod failed to start running: %v" , t .dnsServerPod )
324
323
@@ -373,7 +372,7 @@ func (t *dnsTestCommon) createDNSServerWithPtrRecord(isIPv6 bool) {
373
372
func (t * dnsTestCommon ) deleteDNSServerPod () {
374
373
podClient := t .c .CoreV1 ().Pods (t .f .Namespace .Name )
375
374
if err := podClient .Delete (t .dnsServerPod .Name , metav1 .NewDeleteOptions (0 )); err != nil {
376
- e2elog .Logf ("Delete of pod %v/%v failed: %v" ,
375
+ framework .Logf ("Delete of pod %v/%v failed: %v" ,
377
376
t .utilPod .Namespace , t .dnsServerPod .Name , err )
378
377
}
379
378
}
@@ -495,7 +494,7 @@ func createProbeCommand(namesToResolve []string, hostEntries []string, ptrLookup
495
494
if len (ptrLookupIP ) > 0 {
496
495
ptrLookup , err := dnsutil .ReverseAddr (ptrLookupIP )
497
496
if err != nil {
498
- e2elog .Failf ("Unable to obtain reverse IP address record from IP %s: %v" , ptrLookupIP , err )
497
+ framework .Failf ("Unable to obtain reverse IP address record from IP %s: %v" , ptrLookupIP , err )
499
498
}
500
499
ptrRecByUDPFileName := fmt .Sprintf ("%s_udp@PTR" , ptrLookupIP )
501
500
ptrRecByTCPFileName := fmt .Sprintf ("%s_tcp@PTR" , ptrLookupIP )
@@ -542,20 +541,20 @@ func assertFilesContain(fileNames []string, fileDir string, pod *v1.Pod, client
542
541
543
542
if err != nil {
544
543
if ctx .Err () != nil {
545
- e2elog .Failf ("Unable to read %s from pod %s/%s: %v" , fileName , pod .Namespace , pod .Name , err )
544
+ framework .Failf ("Unable to read %s from pod %s/%s: %v" , fileName , pod .Namespace , pod .Name , err )
546
545
} else {
547
- e2elog .Logf ("Unable to read %s from pod %s/%s: %v" , fileName , pod .Namespace , pod .Name , err )
546
+ framework .Logf ("Unable to read %s from pod %s/%s: %v" , fileName , pod .Namespace , pod .Name , err )
548
547
}
549
548
failed = append (failed , fileName )
550
549
} else if check && strings .TrimSpace (string (contents )) != expected {
551
- e2elog .Logf ("File %s from pod %s/%s contains '%s' instead of '%s'" , fileName , pod .Namespace , pod .Name , string (contents ), expected )
550
+ framework .Logf ("File %s from pod %s/%s contains '%s' instead of '%s'" , fileName , pod .Namespace , pod .Name , string (contents ), expected )
552
551
failed = append (failed , fileName )
553
552
}
554
553
}
555
554
if len (failed ) == 0 {
556
555
return true , nil
557
556
}
558
- e2elog .Logf ("Lookups using %s/%s failed for: %v\n " , pod .Namespace , pod .Name , failed )
557
+ framework .Logf ("Lookups using %s/%s failed for: %v\n " , pod .Namespace , pod .Name , failed )
559
558
return false , nil
560
559
}))
561
560
framework .ExpectEqual (len (failed ), 0 )
@@ -570,23 +569,23 @@ func validateDNSResults(f *framework.Framework, pod *v1.Pod, fileNames []string)
570
569
podClient .Delete (pod .Name , metav1 .NewDeleteOptions (0 ))
571
570
}()
572
571
if _ , err := podClient .Create (pod ); err != nil {
573
- e2elog .Failf ("ginkgo.Failed to create pod %s/%s: %v" , pod .Namespace , pod .Name , err )
572
+ framework .Failf ("ginkgo.Failed to create pod %s/%s: %v" , pod .Namespace , pod .Name , err )
574
573
}
575
574
576
575
framework .ExpectNoError (f .WaitForPodRunning (pod .Name ))
577
576
578
577
ginkgo .By ("retrieving the pod" )
579
578
pod , err := podClient .Get (pod .Name , metav1.GetOptions {})
580
579
if err != nil {
581
- e2elog .Failf ("ginkgo.Failed to get pod %s/%s: %v" , pod .Namespace , pod .Name , err )
580
+ framework .Failf ("ginkgo.Failed to get pod %s/%s: %v" , pod .Namespace , pod .Name , err )
582
581
}
583
582
// Try to find results for each expected name.
584
583
ginkgo .By ("looking for the results for each expected name from probers" )
585
584
assertFilesExist (fileNames , "results" , pod , f .ClientSet )
586
585
587
586
// TODO: probe from the host, too.
588
587
589
- e2elog .Logf ("DNS probes using %s/%s succeeded\n " , pod .Namespace , pod .Name )
588
+ framework .Logf ("DNS probes using %s/%s succeeded\n " , pod .Namespace , pod .Name )
590
589
}
591
590
592
591
func validateTargetedProbeOutput (f * framework.Framework , pod * v1.Pod , fileNames []string , value string ) {
@@ -598,21 +597,21 @@ func validateTargetedProbeOutput(f *framework.Framework, pod *v1.Pod, fileNames
598
597
podClient .Delete (pod .Name , metav1 .NewDeleteOptions (0 ))
599
598
}()
600
599
if _ , err := podClient .Create (pod ); err != nil {
601
- e2elog .Failf ("ginkgo.Failed to create pod %s/%s: %v" , pod .Namespace , pod .Name , err )
600
+ framework .Failf ("ginkgo.Failed to create pod %s/%s: %v" , pod .Namespace , pod .Name , err )
602
601
}
603
602
604
603
framework .ExpectNoError (f .WaitForPodRunning (pod .Name ))
605
604
606
605
ginkgo .By ("retrieving the pod" )
607
606
pod , err := podClient .Get (pod .Name , metav1.GetOptions {})
608
607
if err != nil {
609
- e2elog .Failf ("ginkgo.Failed to get pod %s/%s: %v" , pod .Namespace , pod .Name , err )
608
+ framework .Failf ("ginkgo.Failed to get pod %s/%s: %v" , pod .Namespace , pod .Name , err )
610
609
}
611
610
// Try to find the expected value for each expected name.
612
611
ginkgo .By ("looking for the results for each expected name from probers" )
613
612
assertFilesContain (fileNames , "results" , pod , f .ClientSet , true , value )
614
613
615
- e2elog .Logf ("DNS probes using %s succeeded\n " , pod .Name )
614
+ framework .Logf ("DNS probes using %s succeeded\n " , pod .Name )
616
615
}
617
616
618
617
func reverseArray (arr []string ) []string {
0 commit comments