Skip to content

Commit d5e3ad3

Browse files
authored
Improve timing of Qtree REST APIs
1 parent dc657df commit d5e3ad3

File tree

4 files changed

+174
-82
lines changed

4 files changed

+174
-82
lines changed

storage_drivers/ontap/api/abstraction_rest.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,14 @@ func (d OntapAPIREST) VolumeListByAttrs(ctx context.Context, volumeAttrs *Volume
10931093
"guarantee.type",
10941094
"snapshot_policy.name",
10951095
}
1096+
1097+
// Work around ONTAP REST bug where guarantee type is not filtered properly by ignoring it in the query.
1098+
guaranteeType := volumeAttrs.SpaceReserve
1099+
defer func() {
1100+
volumeAttrs.SpaceReserve = guaranteeType
1101+
}()
1102+
volumeAttrs.SpaceReserve = ""
1103+
10961104
volumesResponse, err := d.api.VolumeListByAttrs(ctx, volumeAttrs, fields)
10971105
if err != nil {
10981106
return nil, err
@@ -1115,6 +1123,12 @@ func (d OntapAPIREST) VolumeListByAttrs(ctx context.Context, volumeAttrs *Volume
11151123
if err != nil {
11161124
return nil, err
11171125
}
1126+
1127+
// Work around ONTAP REST bug where guarantee type is not filtered properly by filtering it here.
1128+
if guaranteeType != "" && volumeInfo.SpaceReserve != guaranteeType {
1129+
continue
1130+
}
1131+
11181132
volumes = append(volumes, volumeInfo)
11191133
}
11201134
}

0 commit comments

Comments
 (0)