Skip to content

Commit

Permalink
lxd/storage/drivers: Fix linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
  • Loading branch information
MggMuggins committed May 22, 2024
1 parent 034f8ec commit 478f770
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions lxd/storage/drivers/driver_lvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ func (d *lvm) Delete(op *operations.Operation) error {
return nil
}

// Validate checks that all provide keys are supported and that no conflicting
// or missing configuration is present.
func (d *lvm) Validate(config map[string]string) error {
rules := map[string]func(value string) error{
"size": validate.Optional(validate.IsSize),
Expand Down
4 changes: 3 additions & 1 deletion lxd/storage/drivers/driver_zfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ func (d *zfs) Unmount() (bool, error) {
return true, nil
}

// GetResources returns utilization statistics for the storage pool

Check failure on line 626 in lxd/storage/drivers/driver_zfs.go

View workflow job for this annotation

GitHub Actions / Code

Comment should end in a period (godot)
func (d *zfs) GetResources() (*api.ResourcesStoragePool, error) {
// Get the total amount of space.
availableStr, err := d.getDatasetProperty(d.config["zfs.pool_name"], "available")
Expand Down Expand Up @@ -655,7 +656,8 @@ func (d *zfs) GetResources() (*api.ResourcesStoragePool, error) {
return &res, nil
}

// MigrationType returns the type of transfer methods to be used when doing migrations between pools in preference order.
// MigrationTypes returns the type of transfer methods to be used when doing
// migrations between pools in preference order.
func (d *zfs) MigrationTypes(contentType ContentType, refresh bool, copySnapshots bool) []migration.Type {
var rsyncFeatures []string

Expand Down
6 changes: 3 additions & 3 deletions lxd/storage/drivers/driver_zfs_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ func (d *zfs) CreateVolumeFromMigration(vol VolumeCopy, conn io.ReadWriteCloser,
return fmt.Errorf("Failed sending ZFS migration header: %w", err)
}

err = conn.Close() //End the frame.
err = conn.Close() // End the frame.
if err != nil {
return fmt.Errorf("Failed closing ZFS migration header frame: %w", err)
}
Expand Down Expand Up @@ -2517,7 +2517,7 @@ func (d *zfs) MigrateVolume(vol VolumeCopy, conn io.ReadWriteCloser, volSrcArgs
return fmt.Errorf("Failed sending ZFS migration header: %w", err)
}

err = conn.Close() //End the frame.
err = conn.Close() // End the frame.
if err != nil {
return fmt.Errorf("Failed closing ZFS migration header frame: %w", err)
}
Expand Down Expand Up @@ -3187,7 +3187,7 @@ func (d *zfs) mountVolumeSnapshot(snapVol Volume, snapshotDataset string, mountP
return cleanup, nil
}

// UnmountVolume simulates unmounting a volume snapshot.
// UnmountVolumeSnapshot simulates unmounting a volume snapshot.
func (d *zfs) UnmountVolumeSnapshot(snapVol Volume, op *operations.Operation) (bool, error) {
unlock, err := snapVol.MountLock()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions lxd/storage/drivers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,9 @@ func loopDeviceSetup(sourcePath string) (string, error) {
if err != nil {
return "", err
}
} else {
return "", err
}

return "", err
}

Check failure on line 831 in lxd/storage/drivers/utils.go

View workflow job for this annotation

GitHub Actions / Code

ineffectual assignment to out (ineffassign)

return strings.TrimSpace(out), nil
Expand Down

0 comments on commit 478f770

Please sign in to comment.