@@ -57,7 +57,6 @@ import (
57
57
e2eauth "k8s.io/kubernetes/test/e2e/framework/auth"
58
58
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
59
59
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
60
- e2epv "k8s.io/kubernetes/test/e2e/framework/pv"
61
60
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
62
61
e2evolume "k8s.io/kubernetes/test/e2e/framework/volume"
63
62
storageframework "k8s.io/kubernetes/test/e2e/storage/framework"
@@ -802,14 +801,7 @@ type gcePdDriver struct {
802
801
driverInfo storageframework.DriverInfo
803
802
}
804
803
805
- type gcePdVolume struct {
806
- volumeName string
807
- }
808
-
809
804
var _ storageframework.TestDriver = & gcePdDriver {}
810
- var _ storageframework.PreprovisionedVolumeTestDriver = & gcePdDriver {}
811
- var _ storageframework.InlineVolumeTestDriver = & gcePdDriver {}
812
- var _ storageframework.PreprovisionedPVTestDriver = & gcePdDriver {}
813
805
var _ storageframework.DynamicPVTestDriver = & gcePdDriver {}
814
806
815
807
// InitGcePdDriver returns gcePdDriver that implements TestDriver interface
@@ -898,40 +890,6 @@ func (g *gcePdDriver) SkipUnsupportedTest(pattern storageframework.TestPattern)
898
890
}
899
891
}
900
892
901
- func (g * gcePdDriver ) GetVolumeSource (readOnly bool , fsType string , e2evolume storageframework.TestVolume ) * v1.VolumeSource {
902
- gv , ok := e2evolume .(* gcePdVolume )
903
- if ! ok {
904
- framework .Failf ("Failed to cast test volume of type %T to the GCE PD test volume" , e2evolume )
905
- }
906
- volSource := v1.VolumeSource {
907
- GCEPersistentDisk : & v1.GCEPersistentDiskVolumeSource {
908
- PDName : gv .volumeName ,
909
- ReadOnly : readOnly ,
910
- },
911
- }
912
- if fsType != "" {
913
- volSource .GCEPersistentDisk .FSType = fsType
914
- }
915
- return & volSource
916
- }
917
-
918
- func (g * gcePdDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , e2evolume storageframework.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
919
- gv , ok := e2evolume .(* gcePdVolume )
920
- if ! ok {
921
- framework .Failf ("Failed to cast test volume of type %T to the GCE PD test volume" , e2evolume )
922
- }
923
- pvSource := v1.PersistentVolumeSource {
924
- GCEPersistentDisk : & v1.GCEPersistentDiskVolumeSource {
925
- PDName : gv .volumeName ,
926
- ReadOnly : readOnly ,
927
- },
928
- }
929
- if fsType != "" {
930
- pvSource .GCEPersistentDisk .FSType = fsType
931
- }
932
- return & pvSource , nil
933
- }
934
-
935
893
func (g * gcePdDriver ) GetDynamicProvisionStorageClass (ctx context.Context , config * storageframework.PerTestConfig , fsType string ) * storagev1.StorageClass {
936
894
provisioner := "kubernetes.io/gce-pd"
937
895
parameters := map [string ]string {}
@@ -962,29 +920,6 @@ func (g *gcePdDriver) PrepareTest(ctx context.Context, f *framework.Framework) *
962
920
963
921
}
964
922
965
- func (g * gcePdDriver ) CreateVolume (ctx context.Context , config * storageframework.PerTestConfig , volType storageframework.TestVolType ) storageframework.TestVolume {
966
- zone := getInlineVolumeZone (ctx , config .Framework )
967
- if volType == storageframework .InlineVolume {
968
- // PD will be created in framework.TestContext.CloudConfig.Zone zone,
969
- // so pods should be also scheduled there.
970
- config .ClientNodeSelection = e2epod.NodeSelection {
971
- Selector : map [string ]string {
972
- v1 .LabelTopologyZone : zone ,
973
- },
974
- }
975
- }
976
- ginkgo .By ("creating a test gce pd volume" )
977
- vname , err := e2epv .CreatePDWithRetryAndZone (ctx , zone )
978
- framework .ExpectNoError (err )
979
- return & gcePdVolume {
980
- volumeName : vname ,
981
- }
982
- }
983
-
984
- func (v * gcePdVolume ) DeleteVolume (ctx context.Context ) {
985
- _ = e2epv .DeletePDWithRetry (ctx , v .volumeName )
986
- }
987
-
988
923
// vSphere
989
924
type vSphereDriver struct {
990
925
driverInfo storageframework.DriverInfo
@@ -1437,24 +1372,6 @@ func cleanUpVolumeServer(ctx context.Context, f *framework.Framework, serverPod
1437
1372
cleanUpVolumeServerWithSecret (ctx , f , serverPod , nil )
1438
1373
}
1439
1374
1440
- func getInlineVolumeZone (ctx context.Context , f * framework.Framework ) string {
1441
- if framework .TestContext .CloudConfig .Zone != "" {
1442
- return framework .TestContext .CloudConfig .Zone
1443
- }
1444
- // if zone is not specified we will randomly pick a zone from schedulable nodes for inline tests
1445
- node , err := e2enode .GetRandomReadySchedulableNode (ctx , f .ClientSet )
1446
- framework .ExpectNoError (err )
1447
- zone , ok := node .Labels [v1 .LabelFailureDomainBetaZone ]
1448
- if ok {
1449
- return zone
1450
- }
1451
- topologyZone , ok := node .Labels [v1 .LabelTopologyZone ]
1452
- if ok {
1453
- return topologyZone
1454
- }
1455
- return ""
1456
- }
1457
-
1458
1375
// cleanUpVolumeServerWithSecret is a wrapper of cleanup function for volume server with secret created by specific CreateStorageServer function.
1459
1376
func cleanUpVolumeServerWithSecret (ctx context.Context , f * framework.Framework , serverPod * v1.Pod , secret * v1.Secret ) {
1460
1377
cs := f .ClientSet
0 commit comments