daemon/graphdriver: fix empty-lines (revive)

daemon/graphdriver/aufs/aufs.go:239:80: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/graphtest/graphbench_unix.go:249:27: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/graphtest/testutil.go:271:30: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/graphtest/graphbench_unix.go:179:32: empty-block: this block is empty, you can remove it (revive)
    daemon/graphdriver/zfs/zfs.go:375:48: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/overlay/overlay.go:248:89: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:636:21: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1150:70: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1613:30: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1645:65: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/btrfs/btrfs.go:53:101: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1944:89: empty-lines: extra empty line at the start of a block (revive)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9d9cca49b4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-09-23 22:30:17 +02:00
parent 79caa2f955
commit aea1aa0daa
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
7 changed files with 2 additions and 13 deletions

View file

@ -237,7 +237,6 @@ func (a *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts
// Create three folders for each id // Create three folders for each id
// mnt, layers, and diff // mnt, layers, and diff
func (a *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error { func (a *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error {
if opts != nil && len(opts.StorageOpt) != 0 { if opts != nil && len(opts.StorageOpt) != 0 {
return fmt.Errorf("--storage-opt is not supported for aufs") return fmt.Errorf("--storage-opt is not supported for aufs")
} }

View file

@ -51,7 +51,6 @@ type btrfsOptions struct {
// Init returns a new BTRFS driver. // Init returns a new BTRFS driver.
// An error is returned if BTRFS is not supported. // An error is returned if BTRFS is not supported.
func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdriver.Driver, error) { func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdriver.Driver, error) {
// Perform feature detection on /var/lib/docker/btrfs if it's an existing directory. // Perform feature detection on /var/lib/docker/btrfs if it's an existing directory.
// This covers situations where /var/lib/docker/btrfs is a mount, and on a different // This covers situations where /var/lib/docker/btrfs is a mount, and on a different
// filesystem than /var/lib/docker. // filesystem than /var/lib/docker.

View file

@ -647,7 +647,6 @@ func (devices *DeviceSet) migrateOldMetaData() error {
if err := os.Rename(devices.oldMetadataFile(), devices.oldMetadataFile()+".migrated"); err != nil { if err := os.Rename(devices.oldMetadataFile(), devices.oldMetadataFile()+".migrated"); err != nil {
return err return err
} }
} }
return nil return nil
@ -1148,7 +1147,6 @@ func (devices *DeviceSet) setupVerifyBaseImageUUIDFS(baseInfo *devInfo) error {
} }
func (devices *DeviceSet) checkGrowBaseDeviceFS(info *devInfo) error { func (devices *DeviceSet) checkGrowBaseDeviceFS(info *devInfo) error {
if !userBaseSize { if !userBaseSize {
return nil return nil
} }
@ -1622,7 +1620,6 @@ func (devices *DeviceSet) loadThinPoolLoopBackInfo() error {
devices.dataDevice = dataLoopDevice devices.dataDevice = dataLoopDevice
devices.dataLoopFile = datafilename devices.dataLoopFile = datafilename
} }
} }
// metadata device has not been passed in. So there should be a // metadata device has not been passed in. So there should be a
@ -1643,7 +1640,6 @@ func (devices *DeviceSet) loadThinPoolLoopBackInfo() error {
} }
func (devices *DeviceSet) enableDeferredRemovalDeletion() error { func (devices *DeviceSet) enableDeferredRemovalDeletion() error {
// If user asked for deferred removal then check both libdm library // If user asked for deferred removal then check both libdm library
// and kernel driver support deferred removal otherwise error out. // and kernel driver support deferred removal otherwise error out.
if enableDeferredRemoval { if enableDeferredRemoval {
@ -1946,7 +1942,6 @@ func (devices *DeviceSet) AddDevice(hash, baseHash string, storageOpt map[string
} }
func (devices *DeviceSet) parseStorageOpt(storageOpt map[string]string) (uint64, error) { func (devices *DeviceSet) parseStorageOpt(storageOpt map[string]string) (uint64, error) {
// Read size to change the block device size per container. // Read size to change the block device size per container.
for key, val := range storageOpt { for key, val := range storageOpt {
key := strings.ToLower(key) key := strings.ToLower(key)

View file

@ -175,10 +175,10 @@ func DriverBenchDiffApplyN(b *testing.B, fileCount int, drivername string, drive
// suppressing "SA9003: empty branch (staticcheck)" instead of commenting-out/removing // suppressing "SA9003: empty branch (staticcheck)" instead of commenting-out/removing
// these lines because removing/commenting these lines causes a ripple effect // these lines because removing/commenting these lines causes a ripple effect
// of changes, and there's still a to-do below // of changes, and there's still a to-do below
//nolint:staticcheck //nolint:staticcheck,revive
if applyDiffSize != diffSize { if applyDiffSize != diffSize {
// TODO: enforce this // TODO: enforce this
//b.Fatalf("Apply diff size different, got %d, expected %s", applyDiffSize, diffSize) // b.Fatalf("Apply diff size different, got %d, expected %s", applyDiffSize, diffSize)
} }
if err := checkManyFiles(driver, diff, fileCount, 6); err != nil { if err := checkManyFiles(driver, diff, fileCount, 6); err != nil {
b.Fatal(err) b.Fatal(err)
@ -247,7 +247,6 @@ func DriverBenchDeepLayerRead(b *testing.B, layerCount int, drivername string, d
b.ResetTimer() b.ResetTimer()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
// Read content // Read content
c, err := contdriver.ReadFile(root, root.Join(root.Path(), "testfile.txt")) c, err := contdriver.ReadFile(root, root.Join(root.Path(), "testfile.txt"))
if err != nil { if err != nil {

View file

@ -278,7 +278,6 @@ func addManyLayers(drv graphdriver.Driver, baseLayer string, count int) (string,
} }
lastLayer = nextLayer lastLayer = nextLayer
} }
return lastLayer, nil return lastLayer, nil
} }

View file

@ -246,7 +246,6 @@ func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts
// Create is used to create the upper, lower, and merge directories required for overlay fs for a given id. // Create is used to create the upper, lower, and merge directories required for overlay fs for a given id.
// The parent filesystem is used to configure these directories for the overlay. // The parent filesystem is used to configure these directories for the overlay.
func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error) { func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error) {
if opts != nil && len(opts.StorageOpt) != 0 { if opts != nil && len(opts.StorageOpt) != 0 {
return fmt.Errorf("--storage-opt is not supported for overlay") return fmt.Errorf("--storage-opt is not supported for overlay")
} }

View file

@ -379,7 +379,6 @@ func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr e
if rmErr := unix.Rmdir(mountpoint); rmErr != nil && !os.IsNotExist(rmErr) { if rmErr := unix.Rmdir(mountpoint); rmErr != nil && !os.IsNotExist(rmErr) {
logrus.WithField("storage-driver", "zfs").Debugf("Failed to remove %s: %v", id, rmErr) logrus.WithField("storage-driver", "zfs").Debugf("Failed to remove %s: %v", id, rmErr)
} }
} }
} }
}() }()