Skip to content

Commit a4021a5

Browse files
committed
Lint fix
Signed-off-by: bpopovschi <[email protected]>
1 parent fb88b14 commit a4021a5

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

agent/drive_handler.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,10 @@ func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriv
219219
}
220220

221221
func (dh driveHandler) UnmountDrive(ctx context.Context, req *drivemount.UnmountDriveRequest) (*empty.Empty, error) {
222-
logger := log.G(ctx)
223-
logger.Debugf("%+v", req.String())
224-
logger = logger.WithField("drive_id", req.DriveID)
225-
226222
drive, ok := dh.GetDrive(req.DriveID)
227223
if !ok {
228224
return nil, fmt.Errorf("drive %q could not be found", req.DriveID)
229225
}
230-
logger = logger.WithField("drive_path", drive.Path())
231226

232227
// Do a basic check that we won't be mounting over any important system directories
233228
if err := checkImportantDirs(req.DestinationPath); err != nil {

runtime/drive_handler.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,31 +128,31 @@ func (h *StubDriveHandler) Reserve(
128128
// and pushes just released drive to freeDrives
129129
func (h *StubDriveHandler) Release(
130130
requestCtx context.Context,
131-
driveId string,
131+
driveID string,
132132
driveMounter drivemount.DriveMounterService,
133133
machine firecracker.MachineIface,
134134
) error {
135135
h.mu.Lock()
136136
defer h.mu.Unlock()
137-
drive, ok := h.usedDrives[driveId]
137+
drive, ok := h.usedDrives[driveID]
138138
if !ok {
139139
return errors.Errorf("container %s drive wasn't found")
140140
}
141141

142142
_, err := driveMounter.UnmountDrive(requestCtx, &drivemount.UnmountDriveRequest{
143-
DriveID: driveId,
143+
DriveID: driveID,
144144
DestinationPath: drive.driveMount.VMPath,
145145
})
146146
if err != nil {
147147
return errors.Wrap(err, "failed to unmount drive")
148148
}
149149

150-
err = machine.UpdateGuestDrive(requestCtx, driveId, drive.driveMount.HostPath)
150+
err = machine.UpdateGuestDrive(requestCtx, driveID, drive.driveMount.HostPath)
151151
if err != nil {
152152
return errors.Wrap(err, "failed to patch drive")
153153
}
154154

155-
delete(h.usedDrives, driveId)
155+
delete(h.usedDrives, driveID)
156156
h.freeDrives = append(h.freeDrives, drive)
157157
return nil
158158
}

0 commit comments

Comments
 (0)