Skip to content

Commit b0c66eb

Browse files
committed
fix lint
1 parent 4e3f9eb commit b0c66eb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pkg/cloud/fake/fake.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (f *fakeConnector) ExpandVolume(_ context.Context, volumeID string, newSize
139139
return cloud.ErrNotFound
140140
}
141141

142-
func (f *fakeConnector) CreateVolumeFromSnapshot(_ context.Context, zoneID, name, projectID, snapshotID string, sizeInGB int64) (*cloud.Volume, error) {
142+
func (f *fakeConnector) CreateVolumeFromSnapshot(_ context.Context, zoneID, name, _, snapshotID string, sizeInGB int64) (*cloud.Volume, error) {
143143
vol := &cloud.Volume{
144144
ID: "fake-vol-from-snap-" + name,
145145
Name: name,

pkg/mount/mount.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,13 @@ func (m *mounter) getDevicePathForVMware(ctx context.Context, volumeID string) (
182182
if err == nil && isBlock {
183183
if m.verifyDevice(ctx, devicePath, volumeID) {
184184
logger.V(4).Info("Found and verified VMware device", "devicePath", devicePath, "volumeID", volumeID)
185+
185186
return devicePath, nil
186187
}
187188
}
188189
}
189190
}
191+
190192
return "", fmt.Errorf("device not found for volume %s", volumeID)
191193
}
192194

@@ -196,23 +198,27 @@ func (m *mounter) verifyDevice(ctx context.Context, devicePath string, volumeID
196198
size, err := m.GetBlockSizeBytes(devicePath)
197199
if err != nil {
198200
logger.V(4).Info("Failed to get device size", "devicePath", devicePath, "volumeID", volumeID, "error", err)
201+
199202
return false
200203
}
201204
logger.V(5).Info("Device size retrieved", "devicePath", devicePath, "volumeID", volumeID, "sizeBytes", size)
202205

203206
mounted, err := m.isDeviceMounted(devicePath)
204207
if err != nil {
205208
logger.V(4).Info("Failed to check if device is mounted", "devicePath", devicePath, "volumeID", volumeID, "error", err)
209+
206210
return false
207211
}
208212
if mounted {
209213
logger.V(4).Info("Device is already mounted", "devicePath", devicePath, "volumeID", volumeID)
214+
210215
return false
211216
}
212217

213218
props, err := m.getDeviceProperties(devicePath)
214219
if err != nil {
215220
logger.V(4).Info("Failed to get device properties", "devicePath", devicePath, "volumeID", volumeID, "error", err)
221+
216222
return false
217223
}
218224
logger.V(5).Info("Device properties retrieved", "devicePath", devicePath, "volumeID", volumeID, "properties", props)
@@ -226,8 +232,10 @@ func (m *mounter) isDeviceMounted(devicePath string) (bool, error) {
226232
if strings.Contains(err.Error(), "exit status 1") {
227233
return false, nil
228234
}
235+
229236
return false, err
230237
}
238+
231239
return len(output) > 0, nil
232240
}
233241

0 commit comments

Comments
 (0)