@@ -49,7 +49,6 @@ import (
49
49
"k8s.io/apimachinery/pkg/util/wait"
50
50
clientset "k8s.io/client-go/kubernetes"
51
51
"k8s.io/kubernetes/test/e2e/framework"
52
- e2elog "k8s.io/kubernetes/test/e2e/framework/log"
53
52
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
54
53
e2eservice "k8s.io/kubernetes/test/e2e/framework/service"
55
54
"k8s.io/kubernetes/test/e2e/framework/testfiles"
@@ -137,12 +136,12 @@ type E2ELogger struct{}
137
136
138
137
// Infof outputs log.
139
138
func (l * E2ELogger ) Infof (format string , args ... interface {}) {
140
- e2elog .Logf (format , args ... )
139
+ framework .Logf (format , args ... )
141
140
}
142
141
143
142
// Errorf outputs log.
144
143
func (l * E2ELogger ) Errorf (format string , args ... interface {}) {
145
- e2elog .Logf (format , args ... )
144
+ framework .Logf (format , args ... )
146
145
}
147
146
148
147
// ConformanceTests contains a closure with an entry and exit log line.
@@ -337,7 +336,7 @@ func BuildInsecureClient(timeout time.Duration) *http.Client {
337
336
// Ingress, it's updated.
338
337
func createTLSSecret (kubeClient clientset.Interface , namespace , secretName string , hosts ... string ) (host string , rootCA , privKey []byte , err error ) {
339
338
host = strings .Join (hosts , "," )
340
- e2elog .Logf ("Generating RSA cert for host %v" , host )
339
+ framework .Logf ("Generating RSA cert for host %v" , host )
341
340
cert , key , err := GenerateRSACerts (host , true )
342
341
if err != nil {
343
342
return
@@ -354,11 +353,11 @@ func createTLSSecret(kubeClient clientset.Interface, namespace, secretName strin
354
353
var s * v1.Secret
355
354
if s , err = kubeClient .CoreV1 ().Secrets (namespace ).Get (secretName , metav1.GetOptions {}); err == nil {
356
355
// TODO: Retry the update. We don't really expect anything to conflict though.
357
- e2elog .Logf ("Updating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
356
+ framework .Logf ("Updating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
358
357
s .Data = secret .Data
359
358
_ , err = kubeClient .CoreV1 ().Secrets (namespace ).Update (s )
360
359
} else {
361
- e2elog .Logf ("Creating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
360
+ framework .Logf ("Creating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
362
361
_ , err = kubeClient .CoreV1 ().Secrets (namespace ).Create (secret )
363
362
}
364
363
return host , cert , key , err
@@ -474,7 +473,7 @@ func (j *TestJig) Update(update func(ing *networkingv1beta1.Ingress)) {
474
473
for i := 0 ; i < 3 ; i ++ {
475
474
j .Ingress , err = j .Client .NetworkingV1beta1 ().Ingresses (ns ).Get (name , metav1.GetOptions {})
476
475
if err != nil {
477
- e2elog .Failf ("failed to get ingress %s/%s: %v" , ns , name , err )
476
+ framework .Failf ("failed to get ingress %s/%s: %v" , ns , name , err )
478
477
}
479
478
update (j .Ingress )
480
479
j .Ingress , err = j .runUpdate (j .Ingress )
@@ -483,10 +482,10 @@ func (j *TestJig) Update(update func(ing *networkingv1beta1.Ingress)) {
483
482
return
484
483
}
485
484
if ! apierrs .IsConflict (err ) && ! apierrs .IsServerTimeout (err ) {
486
- e2elog .Failf ("failed to update ingress %s/%s: %v" , ns , name , err )
485
+ framework .Failf ("failed to update ingress %s/%s: %v" , ns , name , err )
487
486
}
488
487
}
489
- e2elog .Failf ("too many retries updating ingress %s/%s" , ns , name )
488
+ framework .Failf ("too many retries updating ingress %s/%s" , ns , name )
490
489
}
491
490
492
491
// AddHTTPS updates the ingress to add this secret for these hosts.
@@ -544,7 +543,7 @@ func (j *TestJig) GetRootCA(secretName string) (rootCA []byte) {
544
543
var ok bool
545
544
rootCA , ok = j .RootCAs [secretName ]
546
545
if ! ok {
547
- e2elog .Failf ("Failed to retrieve rootCAs, no recorded secret by name %v" , secretName )
546
+ framework .Failf ("Failed to retrieve rootCAs, no recorded secret by name %v" , secretName )
548
547
}
549
548
return
550
549
}
@@ -676,7 +675,7 @@ func (j *TestJig) pollIngressWithCert(ing *networkingv1beta1.Ingress, address st
676
675
// WaitForIngress returns when it gets the first 200 response
677
676
func (j * TestJig ) WaitForIngress (waitForNodePort bool ) {
678
677
if err := j .WaitForGivenIngressWithTimeout (j .Ingress , waitForNodePort , e2eservice .LoadBalancerPollTimeout ); err != nil {
679
- e2elog .Failf ("error in waiting for ingress to get an address: %s" , err )
678
+ framework .Failf ("error in waiting for ingress to get an address: %s" , err )
680
679
}
681
680
}
682
681
@@ -689,7 +688,7 @@ func (j *TestJig) WaitForIngressToStable() {
689
688
}
690
689
return true , nil
691
690
}); err != nil {
692
- e2elog .Failf ("error in waiting for ingress to stablize: %v" , err )
691
+ framework .Failf ("error in waiting for ingress to stablize: %v" , err )
693
692
}
694
693
}
695
694
@@ -735,7 +734,7 @@ func (j *TestJig) VerifyURL(route, host string, iterations int, interval time.Du
735
734
for i := 0 ; i < iterations ; i ++ {
736
735
b , err := framework .SimpleGET (httpClient , route , host )
737
736
if err != nil {
738
- e2elog .Logf (b )
737
+ framework .Logf (b )
739
738
return err
740
739
}
741
740
j .Logger .Infof ("Verified %v with host %v %d times, sleeping for %v" , route , host , i , interval )
@@ -815,7 +814,7 @@ func (j *TestJig) GetDistinctResponseFromIngress() (sets.String, error) {
815
814
// Wait for the loadbalancer IP.
816
815
address , err := j .WaitForIngressAddress (j .Client , j .Ingress .Namespace , j .Ingress .Name , e2eservice .LoadBalancerPollTimeout )
817
816
if err != nil {
818
- e2elog .Failf ("Ingress failed to acquire an IP address within %v" , e2eservice .LoadBalancerPollTimeout )
817
+ framework .Failf ("Ingress failed to acquire an IP address within %v" , e2eservice .LoadBalancerPollTimeout )
819
818
}
820
819
responses := sets .NewString ()
821
820
timeoutClient := & http.Client {Timeout : IngressReqTimeout }
@@ -846,25 +845,25 @@ func (cont *NginxIngressController) Init() {
846
845
read := func (file string ) string {
847
846
return string (testfiles .ReadOrDie (filepath .Join (IngressManifestPath , "nginx" , file )))
848
847
}
849
- e2elog .Logf ("initializing nginx ingress controller" )
848
+ framework .Logf ("initializing nginx ingress controller" )
850
849
framework .RunKubectlOrDieInput (read ("rc.yaml" ), "create" , "-f" , "-" , fmt .Sprintf ("--namespace=%v" , cont .Ns ))
851
850
852
851
rc , err := cont .Client .CoreV1 ().ReplicationControllers (cont .Ns ).Get ("nginx-ingress-controller" , metav1.GetOptions {})
853
852
framework .ExpectNoError (err )
854
853
cont .rc = rc
855
854
856
- e2elog .Logf ("waiting for pods with label %v" , rc .Spec .Selector )
855
+ framework .Logf ("waiting for pods with label %v" , rc .Spec .Selector )
857
856
sel := labels .SelectorFromSet (labels .Set (rc .Spec .Selector ))
858
857
framework .ExpectNoError (testutils .WaitForPodsWithLabelRunning (cont .Client , cont .Ns , sel ))
859
858
pods , err := cont .Client .CoreV1 ().Pods (cont .Ns ).List (metav1.ListOptions {LabelSelector : sel .String ()})
860
859
framework .ExpectNoError (err )
861
860
if len (pods .Items ) == 0 {
862
- e2elog .Failf ("Failed to find nginx ingress controller pods with selector %v" , sel )
861
+ framework .Failf ("Failed to find nginx ingress controller pods with selector %v" , sel )
863
862
}
864
863
cont .pod = & pods .Items [0 ]
865
864
cont .externalIP , err = framework .GetHostExternalAddress (cont .Client , cont .pod )
866
865
framework .ExpectNoError (err )
867
- e2elog .Logf ("ingress controller running in pod %v on ip %v" , cont .pod .Name , cont .externalIP )
866
+ framework .Logf ("ingress controller running in pod %v on ip %v" , cont .pod .Name , cont .externalIP )
868
867
}
869
868
870
869
func generateBacksideHTTPSIngressSpec (ns string ) * networkingv1beta1.Ingress {
0 commit comments