mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
util: add helper functions for resize of encrypted volume
such as: ResizeEncryptedVolume() and LuksResize() Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
572f39d656
commit
4fa05cb3a1
@ -261,6 +261,17 @@ func OpenEncryptedVolume(ctx context.Context, devicePath, mapperFile, passphrase
|
||||
return err
|
||||
}
|
||||
|
||||
// ResizeEncryptedVolume resizes encrypted volume so that it can be used by the client.
|
||||
func ResizeEncryptedVolume(ctx context.Context, mapperFile string) error {
|
||||
DebugLog(ctx, "Resizing LUKS device %s", mapperFile)
|
||||
_, stderr, err := LuksResize(mapperFile)
|
||||
if err != nil {
|
||||
ErrorLog(ctx, "failed to resize LUKS device %s: %s", mapperFile, stderr)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// CloseEncryptedVolume closes encrypted volume so it can be detached.
|
||||
func CloseEncryptedVolume(ctx context.Context, mapperFile string) error {
|
||||
DebugLog(ctx, "Closing LUKS device %s", mapperFile)
|
||||
|
Reference in New Issue
Block a user