Skip to content

Commit dde8ecf

Browse files
author
Nikolay Andreev
committed
Improve performance during block volume re-encryption
Signed-off-by: Nikolay Andreev <[email protected]>
1 parent c22a9aa commit dde8ecf

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

pkg/csi/service/common/vsphereutil.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -1248,18 +1248,11 @@ func QueryVolumeCryptoKeyByID(
12481248
volumeManager cnsvolume.Manager,
12491249
volumeID string) (*vim25types.CryptoKeyId, error) {
12501250

1251-
result, err := volumeManager.QueryVolumeInfo(ctx, []cnstypes.CnsVolumeId{{Id: volumeID}})
1251+
storageObj, err := volumeManager.RetrieveVStorageObject(ctx, volumeID)
12521252
if err != nil {
12531253
return nil, err
12541254
}
12551255

1256-
blockVolumeInfo, ok := result.VolumeInfo.(*cnstypes.CnsBlockVolumeInfo)
1257-
if !ok {
1258-
return nil, fmt.Errorf("failed to retrieve CNS volume info")
1259-
}
1260-
1261-
storageObj := blockVolumeInfo.VStorageObject
1262-
12631256
diskFileBackingInfo, ok := storageObj.Config.Backing.(*vim25types.BaseConfigInfoDiskFileBackingInfo)
12641257
if !ok {
12651258
return nil, fmt.Errorf("failed to retrieve FCD backing info")

0 commit comments

Comments
 (0)