@@ -31,7 +31,6 @@ import (
31
31
clientset "k8s.io/client-go/kubernetes"
32
32
storageutil "k8s.io/kubernetes/pkg/apis/storage/v1/util"
33
33
"k8s.io/kubernetes/pkg/volume/util"
34
- e2elog "k8s.io/kubernetes/test/e2e/framework/log"
35
34
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
36
35
imageutils "k8s.io/kubernetes/test/utils/image"
37
36
)
@@ -140,15 +139,15 @@ func PVPVCCleanup(c clientset.Interface, ns string, pv *v1.PersistentVolume, pvc
140
139
errs = append (errs , fmt .Errorf ("failed to delete PVC %q: %v" , pvc .Name , err ))
141
140
}
142
141
} else {
143
- e2elog . Logf ("pvc is nil" )
142
+ Logf ("pvc is nil" )
144
143
}
145
144
if pv != nil {
146
145
err := DeletePersistentVolume (c , pv .Name )
147
146
if err != nil {
148
147
errs = append (errs , fmt .Errorf ("failed to delete PV %q: %v" , pv .Name , err ))
149
148
}
150
149
} else {
151
- e2elog . Logf ("pv is nil" )
150
+ Logf ("pv is nil" )
152
151
}
153
152
return errs
154
153
}
@@ -182,7 +181,7 @@ func PVPVCMapCleanup(c clientset.Interface, ns string, pvols PVMap, claims PVCMa
182
181
// DeletePersistentVolume deletes the PV.
183
182
func DeletePersistentVolume (c clientset.Interface , pvName string ) error {
184
183
if c != nil && len (pvName ) > 0 {
185
- e2elog . Logf ("Deleting PersistentVolume %q" , pvName )
184
+ Logf ("Deleting PersistentVolume %q" , pvName )
186
185
err := c .CoreV1 ().PersistentVolumes ().Delete (pvName , nil )
187
186
if err != nil && ! apierrs .IsNotFound (err ) {
188
187
return fmt .Errorf ("PV Delete API error: %v" , err )
@@ -194,7 +193,7 @@ func DeletePersistentVolume(c clientset.Interface, pvName string) error {
194
193
// DeletePersistentVolumeClaim deletes the Claim.
195
194
func DeletePersistentVolumeClaim (c clientset.Interface , pvcName string , ns string ) error {
196
195
if c != nil && len (pvcName ) > 0 {
197
- e2elog . Logf ("Deleting PersistentVolumeClaim %q" , pvcName )
196
+ Logf ("Deleting PersistentVolumeClaim %q" , pvcName )
198
197
err := c .CoreV1 ().PersistentVolumeClaims (ns ).Delete (pvcName , nil )
199
198
if err != nil && ! apierrs .IsNotFound (err ) {
200
199
return fmt .Errorf ("PVC Delete API error: %v" , err )
@@ -208,14 +207,14 @@ func DeletePersistentVolumeClaim(c clientset.Interface, pvcName string, ns strin
208
207
// phase value to expect for the pv bound to the to-be-deleted claim.
209
208
func DeletePVCandValidatePV (c clientset.Interface , ns string , pvc * v1.PersistentVolumeClaim , pv * v1.PersistentVolume , expectPVPhase v1.PersistentVolumePhase ) error {
210
209
pvname := pvc .Spec .VolumeName
211
- e2elog . Logf ("Deleting PVC %v to trigger reclamation of PV %v" , pvc .Name , pvname )
210
+ Logf ("Deleting PVC %v to trigger reclamation of PV %v" , pvc .Name , pvname )
212
211
err := DeletePersistentVolumeClaim (c , pvc .Name , ns )
213
212
if err != nil {
214
213
return err
215
214
}
216
215
217
216
// Wait for the PV's phase to return to be `expectPVPhase`
218
- e2elog . Logf ("Waiting for reclaim process to complete." )
217
+ Logf ("Waiting for reclaim process to complete." )
219
218
err = WaitForPersistentVolumePhase (expectPVPhase , c , pv .Name , Poll , PVReclaimingTimeout )
220
219
if err != nil {
221
220
return fmt .Errorf ("pv %q phase did not become %v: %v" , pv .Name , expectPVPhase , err )
@@ -240,7 +239,7 @@ func DeletePVCandValidatePV(c clientset.Interface, ns string, pvc *v1.Persistent
240
239
}
241
240
}
242
241
243
- e2elog . Logf ("PV %v now in %q phase" , pv .Name , expectPVPhase )
242
+ Logf ("PV %v now in %q phase" , pv .Name , expectPVPhase )
244
243
return nil
245
244
}
246
245
@@ -357,7 +356,7 @@ func CreatePVPVC(c clientset.Interface, pvConfig PersistentVolumeConfig, pvcConf
357
356
if preBind {
358
357
preBindMsg = " pre-bound"
359
358
}
360
- e2elog . Logf ("Creating a PV followed by a%s PVC" , preBindMsg )
359
+ Logf ("Creating a PV followed by a%s PVC" , preBindMsg )
361
360
362
361
// make the pv and pvc definitions
363
362
pv := MakePersistentVolume (pvConfig )
@@ -430,7 +429,7 @@ func CreatePVsPVCs(numpvs, numpvcs int, c clientset.Interface, ns string, pvConf
430
429
// WaitOnPVandPVC waits for the pv and pvc to bind to each other.
431
430
func WaitOnPVandPVC (c clientset.Interface , ns string , pv * v1.PersistentVolume , pvc * v1.PersistentVolumeClaim ) error {
432
431
// Wait for newly created PVC to bind to the PV
433
- e2elog . Logf ("Waiting for PV %v to bind to PVC %v" , pv .Name , pvc .Name )
432
+ Logf ("Waiting for PV %v to bind to PVC %v" , pv .Name , pvc .Name )
434
433
err := WaitForPersistentVolumeClaimPhase (v1 .ClaimBound , c , ns , pvc .Name , Poll , ClaimBindingTimeout )
435
434
if err != nil {
436
435
return fmt .Errorf ("PVC %q did not become Bound: %v" , pvc .Name , err )
@@ -486,8 +485,8 @@ func WaitAndVerifyBinds(c clientset.Interface, ns string, pvols PVMap, claims PV
486
485
for pvName := range pvols {
487
486
err := WaitForPersistentVolumePhase (v1 .VolumeBound , c , pvName , Poll , PVBindingTimeout )
488
487
if err != nil && len (pvols ) > len (claims ) {
489
- e2elog . Logf ("WARN: pv %v is not bound after max wait" , pvName )
490
- e2elog . Logf (" This may be ok since there are more pvs than pvcs" )
488
+ Logf ("WARN: pv %v is not bound after max wait" , pvName )
489
+ Logf (" This may be ok since there are more pvs than pvcs" )
491
490
continue
492
491
}
493
492
if err != nil {
@@ -527,7 +526,7 @@ func testPodSuccessOrFail(c clientset.Interface, ns string, pod *v1.Pod) error {
527
526
if err := e2epod .WaitForPodSuccessInNamespace (c , pod .Name , ns ); err != nil {
528
527
return fmt .Errorf ("pod %q failed to reach Success: %v" , pod .Name , err )
529
528
}
530
- e2elog . Logf ("Pod %v succeeded " , pod .Name )
529
+ Logf ("Pod %v succeeded " , pod .Name )
531
530
return nil
532
531
}
533
532
@@ -543,15 +542,15 @@ func DeletePodWithWait(f *Framework, c clientset.Interface, pod *v1.Pod) error {
543
542
// DeletePodWithWaitByName deletes the named and namespaced pod and waits for the pod to be terminated. Resilient to the pod
544
543
// not existing.
545
544
func DeletePodWithWaitByName (f * Framework , c clientset.Interface , podName , podNamespace string ) error {
546
- e2elog . Logf ("Deleting pod %q in namespace %q" , podName , podNamespace )
545
+ Logf ("Deleting pod %q in namespace %q" , podName , podNamespace )
547
546
err := c .CoreV1 ().Pods (podNamespace ).Delete (podName , nil )
548
547
if err != nil {
549
548
if apierrs .IsNotFound (err ) {
550
549
return nil // assume pod was already deleted
551
550
}
552
551
return fmt .Errorf ("pod Delete API error: %v" , err )
553
552
}
554
- e2elog . Logf ("Wait up to %v for pod %q to be fully deleted" , PodDeleteTimeout , podName )
553
+ Logf ("Wait up to %v for pod %q to be fully deleted" , PodDeleteTimeout , podName )
555
554
err = f .WaitForPodNotFound (podName , PodDeleteTimeout )
556
555
if err != nil {
557
556
return fmt .Errorf ("pod %q was not deleted: %v" , podName , err )
@@ -563,7 +562,7 @@ func DeletePodWithWaitByName(f *Framework, c clientset.Interface, podName, podNa
563
562
// Note: need named return value so that the err assignment in the defer sets the returned error.
564
563
// Has been shown to be necessary using Go 1.7.
565
564
func CreateWaitAndDeletePod (f * Framework , c clientset.Interface , ns string , pvc * v1.PersistentVolumeClaim ) (err error ) {
566
- e2elog . Logf ("Creating nfs test pod" )
565
+ Logf ("Creating nfs test pod" )
567
566
pod := MakeWritePod (ns , pvc )
568
567
runPod , err := c .CoreV1 ().Pods (ns ).Create (pod )
569
568
if err != nil {
@@ -663,7 +662,7 @@ func MakePersistentVolumeClaim(cfg PersistentVolumeClaimConfig, ns string) *v1.P
663
662
}
664
663
665
664
if cfg .VolumeMode != nil && * cfg .VolumeMode == "" {
666
- e2elog . Logf ("Warning: Making PVC: VolumeMode specified as invalid empty string, treating as nil" )
665
+ Logf ("Warning: Making PVC: VolumeMode specified as invalid empty string, treating as nil" )
667
666
cfg .VolumeMode = nil
668
667
}
669
668
@@ -693,10 +692,10 @@ func createPDWithRetry(zone string) (string, error) {
693
692
for start := time .Now (); time .Since (start ) < pdRetryTimeout ; time .Sleep (pdRetryPollTime ) {
694
693
newDiskName , err = createPD (zone )
695
694
if err != nil {
696
- e2elog . Logf ("Couldn't create a new PD, sleeping 5 seconds: %v" , err )
695
+ Logf ("Couldn't create a new PD, sleeping 5 seconds: %v" , err )
697
696
continue
698
697
}
699
- e2elog . Logf ("Successfully created a new PD: %q." , newDiskName )
698
+ Logf ("Successfully created a new PD: %q." , newDiskName )
700
699
return newDiskName , nil
701
700
}
702
701
return "" , err
@@ -718,10 +717,10 @@ func DeletePDWithRetry(diskName string) error {
718
717
for start := time .Now (); time .Since (start ) < pdRetryTimeout ; time .Sleep (pdRetryPollTime ) {
719
718
err = deletePD (diskName )
720
719
if err != nil {
721
- e2elog . Logf ("Couldn't delete PD %q, sleeping %v: %v" , diskName , pdRetryPollTime , err )
720
+ Logf ("Couldn't delete PD %q, sleeping %v: %v" , diskName , pdRetryPollTime , err )
722
721
continue
723
722
}
724
- e2elog . Logf ("Successfully deleted PD %q." , diskName )
723
+ Logf ("Successfully deleted PD %q." , diskName )
725
724
return nil
726
725
}
727
726
return fmt .Errorf ("unable to delete PD %q: %v" , diskName , err )
@@ -1096,7 +1095,7 @@ func GetDefaultStorageClassName(c clientset.Interface) (string, error) {
1096
1095
if len (scName ) == 0 {
1097
1096
return "" , fmt .Errorf ("No default storage class found" )
1098
1097
}
1099
- e2elog . Logf ("Default storage class: %q" , scName )
1098
+ Logf ("Default storage class: %q" , scName )
1100
1099
return scName , nil
1101
1100
}
1102
1101
0 commit comments