Skip to content

Commit 39ea84d

Browse files
committed
Use var
1 parent d22fffb commit 39ea84d

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

pkg/server/node.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
8282
}
8383

8484
// Determine the device path: use encrypted mapper device if available, otherwise raw LV
85-
var (
86-
volID = req.GetVolumeId()
87-
mapperName = lvm.LuksMapperName(volID)
88-
devicePath = ""
85+
var (
86+
volID = req.GetVolumeId()
87+
mapperName = lvm.LuksMapperName(volID)
88+
devicePath = ""
8989
)
9090
encryptedPath, err := lvm.EncryptedDevicePath(d.log, mapperName)
9191
if err != nil {
@@ -203,10 +203,10 @@ func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolu
203203
return nil, status.Error(codes.InvalidArgument, "target path missing in request")
204204
}
205205

206-
var (
207-
volumeID = req.GetVolumeId()
208-
mapperName = lvm.LuksMapperName(volumeID)
209-
)
206+
var (
207+
volumeID = req.GetVolumeId()
208+
mapperName = lvm.LuksMapperName(volumeID)
209+
)
210210

211211
// Check if there is an active LUKS device for this volume
212212
encryptedPath, err := lvm.EncryptedDevicePath(d.log, mapperName)
@@ -326,8 +326,10 @@ func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolume
326326

327327
// For encrypted volumes, we need to extend the LV without auto-resizing the filesystem,
328328
// then resize the LUKS layer, and then resize the filesystem separately.
329-
mapperName := lvm.LuksMapperName(volID)
330-
encryptedPath, err := lvm.EncryptedDevicePath(d.log, mapperName)
329+
var (
330+
mapperName = lvm.LuksMapperName(volID)
331+
encryptedPath, err = lvm.EncryptedDevicePath(d.log, mapperName)
332+
)
331333
if err != nil {
332334
return nil, fmt.Errorf("unable to check encrypted device path: %w", err)
333335
}

0 commit comments

Comments
 (0)