@@ -31,7 +31,6 @@ import (
31
31
storageutil "k8s.io/kubernetes/pkg/apis/storage/v1/util"
32
32
"k8s.io/kubernetes/pkg/volume/util"
33
33
"k8s.io/kubernetes/test/e2e/framework"
34
- e2elog "k8s.io/kubernetes/test/e2e/framework/log"
35
34
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
36
35
)
37
36
@@ -143,15 +142,15 @@ func PVPVCCleanup(c clientset.Interface, ns string, pv *v1.PersistentVolume, pvc
143
142
errs = append (errs , fmt .Errorf ("failed to delete PVC %q: %v" , pvc .Name , err ))
144
143
}
145
144
} else {
146
- e2elog .Logf ("pvc is nil" )
145
+ framework .Logf ("pvc is nil" )
147
146
}
148
147
if pv != nil {
149
148
err := DeletePersistentVolume (c , pv .Name )
150
149
if err != nil {
151
150
errs = append (errs , fmt .Errorf ("failed to delete PV %q: %v" , pv .Name , err ))
152
151
}
153
152
} else {
154
- e2elog .Logf ("pv is nil" )
153
+ framework .Logf ("pv is nil" )
155
154
}
156
155
return errs
157
156
}
@@ -185,7 +184,7 @@ func PVPVCMapCleanup(c clientset.Interface, ns string, pvols PVMap, claims PVCMa
185
184
// DeletePersistentVolume deletes the PV.
186
185
func DeletePersistentVolume (c clientset.Interface , pvName string ) error {
187
186
if c != nil && len (pvName ) > 0 {
188
- e2elog .Logf ("Deleting PersistentVolume %q" , pvName )
187
+ framework .Logf ("Deleting PersistentVolume %q" , pvName )
189
188
err := c .CoreV1 ().PersistentVolumes ().Delete (pvName , nil )
190
189
if err != nil && ! apierrs .IsNotFound (err ) {
191
190
return fmt .Errorf ("PV Delete API error: %v" , err )
@@ -197,7 +196,7 @@ func DeletePersistentVolume(c clientset.Interface, pvName string) error {
197
196
// DeletePersistentVolumeClaim deletes the Claim.
198
197
func DeletePersistentVolumeClaim (c clientset.Interface , pvcName string , ns string ) error {
199
198
if c != nil && len (pvcName ) > 0 {
200
- e2elog .Logf ("Deleting PersistentVolumeClaim %q" , pvcName )
199
+ framework .Logf ("Deleting PersistentVolumeClaim %q" , pvcName )
201
200
err := c .CoreV1 ().PersistentVolumeClaims (ns ).Delete (pvcName , nil )
202
201
if err != nil && ! apierrs .IsNotFound (err ) {
203
202
return fmt .Errorf ("PVC Delete API error: %v" , err )
@@ -211,14 +210,14 @@ func DeletePersistentVolumeClaim(c clientset.Interface, pvcName string, ns strin
211
210
// phase value to expect for the pv bound to the to-be-deleted claim.
212
211
func DeletePVCandValidatePV (c clientset.Interface , ns string , pvc * v1.PersistentVolumeClaim , pv * v1.PersistentVolume , expectPVPhase v1.PersistentVolumePhase ) error {
213
212
pvname := pvc .Spec .VolumeName
214
- e2elog .Logf ("Deleting PVC %v to trigger reclamation of PV %v" , pvc .Name , pvname )
213
+ framework .Logf ("Deleting PVC %v to trigger reclamation of PV %v" , pvc .Name , pvname )
215
214
err := DeletePersistentVolumeClaim (c , pvc .Name , ns )
216
215
if err != nil {
217
216
return err
218
217
}
219
218
220
219
// Wait for the PV's phase to return to be `expectPVPhase`
221
- e2elog .Logf ("Waiting for reclaim process to complete." )
220
+ framework .Logf ("Waiting for reclaim process to complete." )
222
221
err = WaitForPersistentVolumePhase (expectPVPhase , c , pv .Name , framework .Poll , PVReclaimingTimeout )
223
222
if err != nil {
224
223
return fmt .Errorf ("pv %q phase did not become %v: %v" , pv .Name , expectPVPhase , err )
@@ -243,7 +242,7 @@ func DeletePVCandValidatePV(c clientset.Interface, ns string, pvc *v1.Persistent
243
242
}
244
243
}
245
244
246
- e2elog .Logf ("PV %v now in %q phase" , pv .Name , expectPVPhase )
245
+ framework .Logf ("PV %v now in %q phase" , pv .Name , expectPVPhase )
247
246
return nil
248
247
}
249
248
@@ -360,7 +359,7 @@ func CreatePVPVC(c clientset.Interface, pvConfig PersistentVolumeConfig, pvcConf
360
359
if preBind {
361
360
preBindMsg = " pre-bound"
362
361
}
363
- e2elog .Logf ("Creating a PV followed by a%s PVC" , preBindMsg )
362
+ framework .Logf ("Creating a PV followed by a%s PVC" , preBindMsg )
364
363
365
364
// make the pv and pvc definitions
366
365
pv := MakePersistentVolume (pvConfig )
@@ -433,7 +432,7 @@ func CreatePVsPVCs(numpvs, numpvcs int, c clientset.Interface, ns string, pvConf
433
432
// WaitOnPVandPVC waits for the pv and pvc to bind to each other.
434
433
func WaitOnPVandPVC (c clientset.Interface , ns string , pv * v1.PersistentVolume , pvc * v1.PersistentVolumeClaim ) error {
435
434
// Wait for newly created PVC to bind to the PV
436
- e2elog .Logf ("Waiting for PV %v to bind to PVC %v" , pv .Name , pvc .Name )
435
+ framework .Logf ("Waiting for PV %v to bind to PVC %v" , pv .Name , pvc .Name )
437
436
err := WaitForPersistentVolumeClaimPhase (v1 .ClaimBound , c , ns , pvc .Name , framework .Poll , ClaimBindingTimeout )
438
437
if err != nil {
439
438
return fmt .Errorf ("PVC %q did not become Bound: %v" , pvc .Name , err )
@@ -489,8 +488,8 @@ func WaitAndVerifyBinds(c clientset.Interface, ns string, pvols PVMap, claims PV
489
488
for pvName := range pvols {
490
489
err := WaitForPersistentVolumePhase (v1 .VolumeBound , c , pvName , framework .Poll , PVBindingTimeout )
491
490
if err != nil && len (pvols ) > len (claims ) {
492
- e2elog .Logf ("WARN: pv %v is not bound after max wait" , pvName )
493
- e2elog .Logf (" This may be ok since there are more pvs than pvcs" )
491
+ framework .Logf ("WARN: pv %v is not bound after max wait" , pvName )
492
+ framework .Logf (" This may be ok since there are more pvs than pvcs" )
494
493
continue
495
494
}
496
495
if err != nil {
@@ -604,7 +603,7 @@ func MakePersistentVolumeClaim(cfg PersistentVolumeClaimConfig, ns string) *v1.P
604
603
}
605
604
606
605
if cfg .VolumeMode != nil && * cfg .VolumeMode == "" {
607
- e2elog .Logf ("Warning: Making PVC: VolumeMode specified as invalid empty string, treating as nil" )
606
+ framework .Logf ("Warning: Making PVC: VolumeMode specified as invalid empty string, treating as nil" )
608
607
cfg .VolumeMode = nil
609
608
}
610
609
@@ -634,10 +633,10 @@ func createPDWithRetry(zone string) (string, error) {
634
633
for start := time .Now (); time .Since (start ) < pdRetryTimeout ; time .Sleep (pdRetryPollTime ) {
635
634
newDiskName , err = createPD (zone )
636
635
if err != nil {
637
- e2elog .Logf ("Couldn't create a new PD, sleeping 5 seconds: %v" , err )
636
+ framework .Logf ("Couldn't create a new PD, sleeping 5 seconds: %v" , err )
638
637
continue
639
638
}
640
- e2elog .Logf ("Successfully created a new PD: %q." , newDiskName )
639
+ framework .Logf ("Successfully created a new PD: %q." , newDiskName )
641
640
return newDiskName , nil
642
641
}
643
642
return "" , err
@@ -659,10 +658,10 @@ func DeletePDWithRetry(diskName string) error {
659
658
for start := time .Now (); time .Since (start ) < pdRetryTimeout ; time .Sleep (pdRetryPollTime ) {
660
659
err = deletePD (diskName )
661
660
if err != nil {
662
- e2elog .Logf ("Couldn't delete PD %q, sleeping %v: %v" , diskName , pdRetryPollTime , err )
661
+ framework .Logf ("Couldn't delete PD %q, sleeping %v: %v" , diskName , pdRetryPollTime , err )
663
662
continue
664
663
}
665
- e2elog .Logf ("Successfully deleted PD %q." , diskName )
664
+ framework .Logf ("Successfully deleted PD %q." , diskName )
666
665
return nil
667
666
}
668
667
return fmt .Errorf ("unable to delete PD %q: %v" , diskName , err )
@@ -710,18 +709,18 @@ func WaitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.Persist
710
709
711
710
// WaitForPersistentVolumePhase waits for a PersistentVolume to be in a specific phase or until timeout occurs, whichever comes first.
712
711
func WaitForPersistentVolumePhase (phase v1.PersistentVolumePhase , c clientset.Interface , pvName string , Poll , timeout time.Duration ) error {
713
- e2elog .Logf ("Waiting up to %v for PersistentVolume %s to have phase %s" , timeout , pvName , phase )
712
+ framework .Logf ("Waiting up to %v for PersistentVolume %s to have phase %s" , timeout , pvName , phase )
714
713
for start := time .Now (); time .Since (start ) < timeout ; time .Sleep (Poll ) {
715
714
pv , err := c .CoreV1 ().PersistentVolumes ().Get (pvName , metav1.GetOptions {})
716
715
if err != nil {
717
- e2elog .Logf ("Get persistent volume %s in failed, ignoring for %v: %v" , pvName , Poll , err )
716
+ framework .Logf ("Get persistent volume %s in failed, ignoring for %v: %v" , pvName , Poll , err )
718
717
continue
719
718
}
720
719
if pv .Status .Phase == phase {
721
- e2elog .Logf ("PersistentVolume %s found and phase=%s (%v)" , pvName , phase , time .Since (start ))
720
+ framework .Logf ("PersistentVolume %s found and phase=%s (%v)" , pvName , phase , time .Since (start ))
722
721
return nil
723
722
}
724
- e2elog .Logf ("PersistentVolume %s found but phase is %s instead of %s." , pvName , pv .Status .Phase , phase )
723
+ framework .Logf ("PersistentVolume %s found but phase is %s instead of %s." , pvName , pv .Status .Phase , phase )
725
724
}
726
725
return fmt .Errorf ("PersistentVolume %s not in phase %s within %v" , pvName , phase , timeout )
727
726
}
@@ -737,22 +736,22 @@ func WaitForPersistentVolumeClaimsPhase(phase v1.PersistentVolumeClaimPhase, c c
737
736
if len (pvcNames ) == 0 {
738
737
return fmt .Errorf ("Incorrect parameter: Need at least one PVC to track. Found 0" )
739
738
}
740
- e2elog .Logf ("Waiting up to %v for PersistentVolumeClaims %v to have phase %s" , timeout , pvcNames , phase )
739
+ framework .Logf ("Waiting up to %v for PersistentVolumeClaims %v to have phase %s" , timeout , pvcNames , phase )
741
740
for start := time .Now (); time .Since (start ) < timeout ; time .Sleep (Poll ) {
742
741
phaseFoundInAllClaims := true
743
742
for _ , pvcName := range pvcNames {
744
743
pvc , err := c .CoreV1 ().PersistentVolumeClaims (ns ).Get (pvcName , metav1.GetOptions {})
745
744
if err != nil {
746
- e2elog .Logf ("Failed to get claim %q, retrying in %v. Error: %v" , pvcName , Poll , err )
745
+ framework .Logf ("Failed to get claim %q, retrying in %v. Error: %v" , pvcName , Poll , err )
747
746
continue
748
747
}
749
748
if pvc .Status .Phase == phase {
750
- e2elog .Logf ("PersistentVolumeClaim %s found and phase=%s (%v)" , pvcName , phase , time .Since (start ))
749
+ framework .Logf ("PersistentVolumeClaim %s found and phase=%s (%v)" , pvcName , phase , time .Since (start ))
751
750
if matchAny {
752
751
return nil
753
752
}
754
753
} else {
755
- e2elog .Logf ("PersistentVolumeClaim %s found but phase is %s instead of %s." , pvcName , pvc .Status .Phase , phase )
754
+ framework .Logf ("PersistentVolumeClaim %s found but phase is %s instead of %s." , pvcName , pvc .Status .Phase , phase )
756
755
phaseFoundInAllClaims = false
757
756
}
758
757
}
@@ -808,7 +807,7 @@ func GetDefaultStorageClassName(c clientset.Interface) (string, error) {
808
807
if len (scName ) == 0 {
809
808
return "" , fmt .Errorf ("No default storage class found" )
810
809
}
811
- e2elog .Logf ("Default storage class: %q" , scName )
810
+ framework .Logf ("Default storage class: %q" , scName )
812
811
return scName , nil
813
812
}
814
813
0 commit comments