@@ -28,10 +28,7 @@ import (
28
28
"strings"
29
29
"time"
30
30
31
- "github.com/gophercloud/gophercloud"
32
- "github.com/gophercloud/gophercloud/openstack"
33
31
"github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
34
- "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumetypes"
35
32
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
36
33
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers"
37
34
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups"
@@ -889,44 +886,3 @@ func isCloudProviderInitialized(taints []corev1.Taint) bool {
889
886
}
890
887
return true
891
888
}
892
-
893
- func findVolumeTypeID (volumeClient * gophercloud.ServiceClient , volumeTypeName string ) (string , error ) {
894
- allPages , err := volumetypes .List (volumeClient , volumetypes.ListOpts {}).AllPages ()
895
- if err != nil {
896
- return "" , err
897
- }
898
-
899
- allVolumeTypes , err := volumetypes .ExtractVolumeTypes (allPages )
900
- if err != nil {
901
- return "" , err
902
- }
903
-
904
- for _ , volumeType := range allVolumeTypes {
905
- if volumeType .Name == volumeTypeName {
906
- return volumeType .ID , nil
907
- }
908
- }
909
-
910
- return "" , fmt .Errorf ("volume type '%s' not found" , volumeTypeName )
911
- }
912
-
913
- func getVolumeType (e2eCtx * shared.E2EContext ) {
914
- providerClient , clientOpts , _ , err := shared .GetAdminProviderClient (e2eCtx )
915
- Expect (err ).NotTo (HaveOccurred (), fmt .Sprintf ("Failed to get admin provider client: %v" , err ))
916
-
917
- volumeClient , err := openstack .NewBlockStorageV3 (providerClient , gophercloud.EndpointOpts {Region : clientOpts .RegionName })
918
- Expect (err ).NotTo (HaveOccurred (), fmt .Sprintf ("Failed to create volume client: %v" , err ))
919
-
920
- volumeTypeName := e2eCtx .E2EConfig .GetVariable ("OPENSTACK_VOLUME_TYPE_ALT" )
921
- Expect (volumeTypeName ).NotTo (BeEmpty (), "Volume type name must not be empty" )
922
-
923
- volumeTypeID , err := findVolumeTypeID (volumeClient , volumeTypeName )
924
- Expect (err ).NotTo (HaveOccurred (), fmt .Sprintf ("Error finding volume type '%s': %v" , volumeTypeName , err ))
925
-
926
- shared .Logf ("Found volume type ID '%s' for volume type '%s'" , volumeTypeID , volumeTypeName )
927
-
928
- _ , err = volumetypes .Get (volumeClient , volumeTypeID ).Extract ()
929
- Expect (err ).NotTo (HaveOccurred (), fmt .Sprintf ("Error retrieving volume type with ID '%s': %v" , volumeTypeID , err ))
930
-
931
- shared .Logf ("Proceeding with volume type ID '%s'." , volumeTypeID )
932
- }
0 commit comments