@@ -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"
@@ -131,12 +130,12 @@ type E2ELogger struct{}
131
130
132
131
// Infof outputs log.
133
132
func (l * E2ELogger ) Infof (format string , args ... interface {}) {
134
- e2elog .Logf (format , args ... )
133
+ framework .Logf (format , args ... )
135
134
}
136
135
137
136
// Errorf outputs log.
138
137
func (l * E2ELogger ) Errorf (format string , args ... interface {}) {
139
- e2elog .Logf (format , args ... )
138
+ framework .Logf (format , args ... )
140
139
}
141
140
142
141
// ConformanceTests contains a closure with an entry and exit log line.
@@ -331,7 +330,7 @@ func BuildInsecureClient(timeout time.Duration) *http.Client {
331
330
// Ingress, it's updated.
332
331
func createTLSSecret (kubeClient clientset.Interface , namespace , secretName string , hosts ... string ) (host string , rootCA , privKey []byte , err error ) {
333
332
host = strings .Join (hosts , "," )
334
- e2elog .Logf ("Generating RSA cert for host %v" , host )
333
+ framework .Logf ("Generating RSA cert for host %v" , host )
335
334
cert , key , err := GenerateRSACerts (host , true )
336
335
if err != nil {
337
336
return
@@ -348,11 +347,11 @@ func createTLSSecret(kubeClient clientset.Interface, namespace, secretName strin
348
347
var s * v1.Secret
349
348
if s , err = kubeClient .CoreV1 ().Secrets (namespace ).Get (secretName , metav1.GetOptions {}); err == nil {
350
349
// TODO: Retry the update. We don't really expect anything to conflict though.
351
- e2elog .Logf ("Updating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
350
+ framework .Logf ("Updating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
352
351
s .Data = secret .Data
353
352
_ , err = kubeClient .CoreV1 ().Secrets (namespace ).Update (s )
354
353
} else {
355
- e2elog .Logf ("Creating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
354
+ framework .Logf ("Creating secret %v in ns %v with hosts %v" , secret .Name , namespace , host )
356
355
_ , err = kubeClient .CoreV1 ().Secrets (namespace ).Create (secret )
357
356
}
358
357
return host , cert , key , err
@@ -468,7 +467,7 @@ func (j *TestJig) Update(update func(ing *networkingv1beta1.Ingress)) {
468
467
for i := 0 ; i < 3 ; i ++ {
469
468
j .Ingress , err = j .Client .NetworkingV1beta1 ().Ingresses (ns ).Get (name , metav1.GetOptions {})
470
469
if err != nil {
471
- e2elog .Failf ("failed to get ingress %s/%s: %v" , ns , name , err )
470
+ framework .Failf ("failed to get ingress %s/%s: %v" , ns , name , err )
472
471
}
473
472
update (j .Ingress )
474
473
j .Ingress , err = j .runUpdate (j .Ingress )
@@ -477,10 +476,10 @@ func (j *TestJig) Update(update func(ing *networkingv1beta1.Ingress)) {
477
476
return
478
477
}
479
478
if ! apierrs .IsConflict (err ) && ! apierrs .IsServerTimeout (err ) {
480
- e2elog .Failf ("failed to update ingress %s/%s: %v" , ns , name , err )
479
+ framework .Failf ("failed to update ingress %s/%s: %v" , ns , name , err )
481
480
}
482
481
}
483
- e2elog .Failf ("too many retries updating ingress %s/%s" , ns , name )
482
+ framework .Failf ("too many retries updating ingress %s/%s" , ns , name )
484
483
}
485
484
486
485
// AddHTTPS updates the ingress to add this secret for these hosts.
@@ -538,7 +537,7 @@ func (j *TestJig) GetRootCA(secretName string) (rootCA []byte) {
538
537
var ok bool
539
538
rootCA , ok = j .RootCAs [secretName ]
540
539
if ! ok {
541
- e2elog .Failf ("Failed to retrieve rootCAs, no recorded secret by name %v" , secretName )
540
+ framework .Failf ("Failed to retrieve rootCAs, no recorded secret by name %v" , secretName )
542
541
}
543
542
return
544
543
}
@@ -670,7 +669,7 @@ func (j *TestJig) pollIngressWithCert(ing *networkingv1beta1.Ingress, address st
670
669
// WaitForIngress returns when it gets the first 200 response
671
670
func (j * TestJig ) WaitForIngress (waitForNodePort bool ) {
672
671
if err := j .WaitForGivenIngressWithTimeout (j .Ingress , waitForNodePort , e2eservice .LoadBalancerPollTimeout ); err != nil {
673
- e2elog .Failf ("error in waiting for ingress to get an address: %s" , err )
672
+ framework .Failf ("error in waiting for ingress to get an address: %s" , err )
674
673
}
675
674
}
676
675
@@ -683,7 +682,7 @@ func (j *TestJig) WaitForIngressToStable() {
683
682
}
684
683
return true , nil
685
684
}); err != nil {
686
- e2elog .Failf ("error in waiting for ingress to stablize: %v" , err )
685
+ framework .Failf ("error in waiting for ingress to stablize: %v" , err )
687
686
}
688
687
}
689
688
@@ -729,7 +728,7 @@ func (j *TestJig) VerifyURL(route, host string, iterations int, interval time.Du
729
728
for i := 0 ; i < iterations ; i ++ {
730
729
b , err := framework .SimpleGET (httpClient , route , host )
731
730
if err != nil {
732
- e2elog .Logf (b )
731
+ framework .Logf (b )
733
732
return err
734
733
}
735
734
j .Logger .Infof ("Verified %v with host %v %d times, sleeping for %v" , route , host , i , interval )
@@ -809,7 +808,7 @@ func (j *TestJig) GetDistinctResponseFromIngress() (sets.String, error) {
809
808
// Wait for the loadbalancer IP.
810
809
address , err := j .WaitForIngressAddress (j .Client , j .Ingress .Namespace , j .Ingress .Name , e2eservice .LoadBalancerPollTimeout )
811
810
if err != nil {
812
- e2elog .Failf ("Ingress failed to acquire an IP address within %v" , e2eservice .LoadBalancerPollTimeout )
811
+ framework .Failf ("Ingress failed to acquire an IP address within %v" , e2eservice .LoadBalancerPollTimeout )
813
812
}
814
813
responses := sets .NewString ()
815
814
timeoutClient := & http.Client {Timeout : IngressReqTimeout }
@@ -840,25 +839,25 @@ func (cont *NginxIngressController) Init() {
840
839
read := func (file string ) string {
841
840
return string (testfiles .ReadOrDie (filepath .Join (IngressManifestPath , "nginx" , file )))
842
841
}
843
- e2elog .Logf ("initializing nginx ingress controller" )
842
+ framework .Logf ("initializing nginx ingress controller" )
844
843
framework .RunKubectlOrDieInput (read ("rc.yaml" ), "create" , "-f" , "-" , fmt .Sprintf ("--namespace=%v" , cont .Ns ))
845
844
846
845
rc , err := cont .Client .CoreV1 ().ReplicationControllers (cont .Ns ).Get ("nginx-ingress-controller" , metav1.GetOptions {})
847
846
framework .ExpectNoError (err )
848
847
cont .rc = rc
849
848
850
- e2elog .Logf ("waiting for pods with label %v" , rc .Spec .Selector )
849
+ framework .Logf ("waiting for pods with label %v" , rc .Spec .Selector )
851
850
sel := labels .SelectorFromSet (labels .Set (rc .Spec .Selector ))
852
851
framework .ExpectNoError (testutils .WaitForPodsWithLabelRunning (cont .Client , cont .Ns , sel ))
853
852
pods , err := cont .Client .CoreV1 ().Pods (cont .Ns ).List (metav1.ListOptions {LabelSelector : sel .String ()})
854
853
framework .ExpectNoError (err )
855
854
if len (pods .Items ) == 0 {
856
- e2elog .Failf ("Failed to find nginx ingress controller pods with selector %v" , sel )
855
+ framework .Failf ("Failed to find nginx ingress controller pods with selector %v" , sel )
857
856
}
858
857
cont .pod = & pods .Items [0 ]
859
858
cont .externalIP , err = framework .GetHostExternalAddress (cont .Client , cont .pod )
860
859
framework .ExpectNoError (err )
861
- e2elog .Logf ("ingress controller running in pod %v on ip %v" , cont .pod .Name , cont .externalIP )
860
+ framework .Logf ("ingress controller running in pod %v on ip %v" , cont .pod .Name , cont .externalIP )
862
861
}
863
862
864
863
func generateBacksideHTTPSIngressSpec (ns string ) * networkingv1beta1.Ingress {
0 commit comments