@@ -111,7 +111,7 @@ func (cloud *CloudProvider) GetDefaultZone() string {
111
111
}
112
112
113
113
// ListDisks lists disks based on maxEntries and pageToken only in the project
114
- // and zone that the driver is running in.
114
+ // and region that the driver is running in.
115
115
func (cloud * CloudProvider ) ListDisks (ctx context.Context ) ([]* computev1.Disk , string , error ) {
116
116
region , err := common .GetRegionFromZones ([]string {cloud .zone })
117
117
if err != nil {
@@ -123,6 +123,20 @@ func (cloud *CloudProvider) ListDisks(ctx context.Context) ([]*computev1.Disk, s
123
123
}
124
124
items := []* computev1.Disk {}
125
125
126
+ // listing out regional disks in the region
127
+ rlCall := cloud .service .RegionDisks .List (cloud .project , region )
128
+ nextPageToken := "pageToken"
129
+ for nextPageToken != "" {
130
+ rDiskList , err := rlCall .Do ()
131
+ if err != nil {
132
+ return nil , "" , err
133
+ }
134
+ items = append (items , rDiskList .Items ... )
135
+ nextPageToken = rDiskList .NextPageToken
136
+ rlCall .PageToken (nextPageToken )
137
+ }
138
+
139
+ // listing out zonal disks in all zones of the region
126
140
for _ , zone := range zones {
127
141
lCall := cloud .service .Disks .List (cloud .project , zone )
128
142
nextPageToken := "pageToken"
0 commit comments