Repository: topolvm/topolvm
Pull request #849 (2024-03-05 08:30:32)

Avoid disk nospace when release workflow
The release workflow failed because of disk no space. see https://github.com/topolvm/topolvm/actions/runs/8137581069/job/22237189098
I doubt actions runner has consumed more disk space than before. To avoid disk exhaustion, use dedicated jobs to build images.

toshipp: The CI passed
https://github.com/topolvm/topolvm/actions/runs/8155224884

Patch:
diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml
new file mode 100644
index 00000000..7fbcd295
--- /dev/null
+++ b/.github/workflows/build-images.yaml
@@ -0,0 +1,43 @@
+on:
+  workflow_call:
+    inputs:
+      topolvm_version:
+        description: "TopoLVM version"
+        default: "devel"
+        type: string
+      image_tag:
+        description: "Image tag"
+        default: "latest"
+        type: string
+      image_prefix:
+        description: "Image prefix"
+        default: ""
+        type: string
+      push:
+        description: "Push images"
+        default: "false"
+        type: string
+
+jobs:
+  build-images:
+    name: "build-images"
+    runs-on: "ubuntu-20.04"
+    strategy:
+      fail-fast: true
+      matrix:
+        image:
+          - "normal"
+          - "with-sidecar"
+    steps:
+      - uses: actions/checkout@v4
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v3
+      - name: Login registry
+        if: ${{ inputs.push == 'true' }}
+        run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+      - run: make multi-platform-image-${{ matrix.image }}
+        env:
+          TOPOLVM_VERSION: ${{ inputs.topolvm_version }}
+          IMAGE_TAG: ${{ inputs.image_tag }}
+          IMAGE_PREFIX: ${{ inputs.image_prefix }}
+          PUSH: ${{ inputs.push }}
diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml
index 7cae10db..5cfaea44 100644
--- a/.github/workflows/helm.yaml
+++ b/.github/workflows/helm.yaml
@@ -21,16 +21,6 @@ jobs:
         with:
           go-version-file: "go.mod"
 
-      - name: cache go dependencies
-        uses: actions/cache@v4
-        with:
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-          key: go-${{ hashFiles('go.sum', 'Makefile', 'versions.mk') }}
-          restore-keys: |
-            go-
-
       - name: "Setup Tools"
         run: |
           make tools
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 0d6d1f62..6660d0f0 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -15,15 +15,6 @@ jobs:
           go-version-file: "go.mod"
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
-      - name: cache go dependencies
-        uses: actions/cache@v4
-        with:
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-          key: go-${{ hashFiles('go.sum', 'Makefile', 'versions.mk') }}
-          restore-keys: |
-            go-
       - run: make setup
       - run: make check-uncommitted
       - run: make test
@@ -31,19 +22,7 @@ jobs:
 
   build-images:
     name: "build-images"
-    runs-on: "ubuntu-20.04"
-    strategy:
-      fail-fast: true
-      matrix:
-        image:
-          - "normal"
-          - "with-sidecar"
-    steps:
-      - uses: actions/checkout@v4
-      - name: Set up Docker Buildx
-        uses: docker/setup-buildx-action@v3
-      - run: make setup-docker-buildx
-      - run: make multi-platform-image-${{ matrix.image }}
+    uses: ./.github/workflows/build-images.yaml
 
   container-structure-test:
     name: "container-structure-test"
@@ -77,14 +56,5 @@ jobs:
           go-version-file: "go.mod"
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
-      - name: cache go dependencies
-        uses: actions/cache@v4
-        with:
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-          key: go-${{ hashFiles('go.sum', 'Makefile', 'versions.mk') }}
-          restore-keys: |
-            go-
       - run: make setup
       - run: make run
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 42b2ab8a..d410a515 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -4,9 +4,13 @@ on:
     tags:
       - "v*"
 jobs:
-  release:
-    name: "release"
-    runs-on: "ubuntu-20.04"
+  prepare:
+    name: "prepare"
+    outputs:
+      version: ${{ steps.check_version.outputs.version }}
+      prerelease: ${{ steps.check_version.outputs.prerelease }}
+      image_prefix: ${{ steps.export_image_prefix.outputs.image_prefix }}
+    runs-on: "ubuntu-latest"
     steps:
       - name: "Validate Release Version"
         id: check_version
@@ -19,35 +23,43 @@ jobs:
           if [ $(echo $VERSION | grep "-") ]; then PRERELEASE=true; else PRERELEASE=false; fi
           echo "version=${VERSION}" >> ${GITHUB_OUTPUT}
           echo "prerelease=${PRERELEASE}" >> ${GITHUB_OUTPUT}
-      - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
       - name: "Export IMAGE_PREFIX"
+        id: export_image_prefix
         run: |
           if [ "${{ secrets.IMAGE_PREFIX }}" != "" ]; then IMAGE_PREFIX=${{ secrets.IMAGE_PREFIX }}; else IMAGE_PREFIX=ghcr.io/topolvm/; fi
-          echo "IMAGE_PREFIX=${IMAGE_PREFIX}" >> $GITHUB_ENV
+          echo "IMAGE_PREFIX=${IMAGE_PREFIX}" >> ${GITHUB_OUTPUT}
+
+  build-images:
+    name: "build-images"
+    needs: prepare
+    uses: ./.github/workflows/build-images.yaml
+    with:
+      topolvm_version: ${{ needs.prepare.outputs.version }}
+      image_tag: ${{ needs.prepare.outputs.version }}
+      image_prefix: ${{ needs.prepare.outputs.image_prefix }}
+      push: "true"
+
+  release:
+    name: "release"
+    needs: [prepare, build-images]
+    runs-on: "ubuntu-20.04"
+    steps:
       - uses: actions/checkout@v4
       - uses: actions/setup-go@v5
         with:
           go-version-file: "go.mod"
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
-      - name: cache go dependencies
-        uses: actions/cache@v4
-        with:
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-          key: go-${{ hashFiles('go.sum', 'Makefile', 'versions.mk') }}
-          restore-keys: |
-            go-
-      - run: make setup
-      - run: make build/lvmd TOPOLVM_VERSION=${{ steps.check_version.outputs.version }}
-      - run: tar czf lvmd-${{ steps.check_version.outputs.version }}.tar.gz -C ./build lvmd
-      - run: make multi-platform-images PUSH=true TOPOLVM_VERSION=${{ steps.check_version.outputs.version }} IMAGE_TAG=${{ steps.check_version.outputs.version }}
+      - run: make build/lvmd TOPOLVM_VERSION=${{ needs.prepare.outputs.version }}
+      - run: tar czf lvmd-${{ needs.prepare.outputs.version }}.tar.gz -C ./build lvmd
       - name: "Push branch tag"
-        if: ${{ steps.check_version.outputs.prerelease == 'false' }}
+        if: ${{ needs.prepare.outputs.prerelease == 'false' }}
         run: |
-          BRANCH=$(echo ${{ steps.check_version.outputs.version }} | cut -d "." -f 1-2)
-          make tag IMAGE_TAG=$BRANCH ORIGINAL_IMAGE_TAG=${{ steps.check_version.outputs.version }}
+          echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+          BRANCH=$(echo ${{ needs.prepare.outputs.version }} | cut -d "." -f 1-2)
+          make tag IMAGE_TAG=$BRANCH ORIGINAL_IMAGE_TAG=${{ needs.preapre.outputs.version }}
+        env:
+          IMAGE_PREFIX: ${{ needs.prepare.outputs.image_prefix }}
       - name: "Get previous tag"
         id: get_previous_tag
         run: |
@@ -78,12 +90,12 @@ jobs:
             -f tag_name="${GITHUB_REF_NAME}" \
             -f previous_tag_name="${{ steps.get_previous_tag.outputs.previous_tag }}" \
             -F draft=true \
-            -F prerelease=${{ steps.check_version.outputs.prerelease }} \
+            -F prerelease=${{ needs.prepare.outputs.prerelease }} \
             -F generate_release_notes=true
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       - name: "Upload Release Asset"
         run: |
-          gh release upload ${GITHUB_REF_NAME} lvmd-${{ steps.check_version.outputs.version }}.tar.gz
+          gh release upload ${GITHUB_REF_NAME} lvmd-${{ needs.prepare.outputs.version }}.tar.gz
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/constants.go b/constants.go
index 531d85ba..59afd8ce 100644
--- a/constants.go
+++ b/constants.go
@@ -94,13 +94,6 @@ const DefaultSizeGb = 1
 // DefaultSize is DefaultSizeGb in bytes
 const DefaultSize = int64(DefaultSizeGb << 30)
 
-// MinimumSectorSize is the minimum size in bytes for volumes (PVC or generic ephemeral volumes).
-// It is derived from the usual sector size of 512,1024 or 4096 bytes for logical volumes.
-// While Sector Sizes of 512 are common, using 4096 is safe
-// As it also aligns with 512 and 1024 byte sectors, and is the default for most modern disks.
-// Going lower than this size will cause validation issues on volume creation for the user.
-const MinimumSectorSize = int64(4096)
-
 // Label key that indicates The controller/user who created this resource
 // https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels
 const CreatedbyLabelKey = "app.kubernetes.io/created-by"
diff --git a/internal/driver/controller.go b/internal/driver/controller.go
index 81b49e72..7340d882 100644
--- a/internal/driver/controller.go
+++ b/internal/driver/controller.go
@@ -430,52 +430,19 @@ func convertRequestCapacityBytes(requestBytes, limitBytes int64) (int64, error)
 		)
 	}
 
-	// if requestBytes is 0 and
-	// 1. if limitBytes == 0, default to 1Gi
-	// 2. if limitBytes >= 1Gi, default to 1Gi
-	// 3. if limitBytes < 1Gi, default to rounded-down 4096 multiple of limitBytes.
-	//    if rounded-down 4096 multiple of limitBytes == 0, return error
+	// if requestBytes is 0, default to max(1Gi, limitBytes>0)
+	// 1. if limitBytes is 0, default to 1Gi
+	// 2. if limitBytes is greater than 1Gi, default to 1Gi
+	// 3. if limitBytes is less than 1Gi, default to limitBytes
 	if requestBytes == 0 {
-		// if there is no limit or the limit is bigger or equal to the default, use the default
-		if limitBytes == 0 || limitBytes >= topolvm.DefaultSize {
-			return topolvm.DefaultSize, nil
-		}
-
-		roundedLimit := roundDown(limitBytes, topolvm.MinimumSectorSize)
-		if roundedLimit == 0 {
-			return 0, fmt.Errorf("requested capacity is 0, because it defaulted to the limit (%d) and was rounded down to the nearest sector size (%d). "+
-				"specify the limit to be at least %d bytes", limitBytes, topolvm.MinimumSectorSize, topolvm.MinimumSectorSize)
-		}
-
-		return roundedLimit, nil
-	}
-
-	if requestBytes%topolvm.MinimumSectorSize != 0 {
-		// round up to the nearest multiple of the sector size
-		requestBytes = roundUp(requestBytes, topolvm.MinimumSectorSize)
-		// after rounding up, we might overshoot the limit
-		if limitBytes > 0 && requestBytes > limitBytes {
-			return 0, fmt.Errorf(
-				"requested capacity rounded to nearest sector size (%d) exceeds limit capacity, "+
-					"either specify a lower request or a higher limit: request=%d limit=%d",
-				topolvm.MinimumSectorSize, requestBytes, limitBytes,
-			)
+		if limitBytes > 0 && topolvm.DefaultSize > limitBytes {
+			return limitBytes, nil
 		}
+		return topolvm.DefaultSize, nil
 	}
-
 	return requestBytes, nil
 }
 
-// roundUp rounds up the size to the nearest given multiple.
-func roundUp(size int64, multiple int64) int64 {
-	return (size + multiple - 1) / multiple * multiple
-}
-
-// roundDown rounds down the size to the nearest given multiple.
-func roundDown(size int64, multiple int64) int64 {
-	return size - size%multiple
-}
-
 func (s controllerServerNoLocked) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) {
 	ctrlLogger.Info("DeleteVolume called",
 		"volume_id", req.GetVolumeId(),
diff --git a/internal/lvmd/command/lvm.go b/internal/lvmd/command/lvm.go
index 90d2aa51..8e2ea64c 100644
--- a/internal/lvmd/command/lvm.go
+++ b/internal/lvmd/command/lvm.go
@@ -5,8 +5,6 @@ import (
 	"errors"
 	"fmt"
 	"path"
-
-	"github.com/topolvm/topolvm"
 )
 
 const (
@@ -17,10 +15,6 @@ const (
 // ErrNotFound is returned when a VG or LV is not found.
 var ErrNotFound = errors.New("not found")
 
-// ErrNoMultipleOfSectorSize is returned when a volume is requested that is smaller than the minimum sector size.
-var ErrNoMultipleOfSectorSize = fmt.Errorf("cannot create volume as given size "+
-	"is not a multiple of %d and could get rejected", topolvm.MinimumSectorSize)
-
 // VolumeGroup represents a volume group of linux lvm.
 // The state should be considered immutable and will not automatically update.
 // The Update method should be called to refresh the state in case it is known that the state may have changed.
@@ -206,11 +200,6 @@ func (vg *VolumeGroup) convertLV(lv lv) *LogicalVolume {
 // lvcreateOptions are additional arguments to pass to lvcreate.
 func (vg *VolumeGroup) CreateVolume(ctx context.Context, name string, size uint64, tags []string, stripe uint, stripeSize string,
 	lvcreateOptions []string) error {
-
-	if size%uint64(topolvm.MinimumSectorSize) != 0 {
-		return ErrNoMultipleOfSectorSize
-	}
-
 	lvcreateArgs := []string{"lvcreate", "-n", name, "-L", fmt.Sprintf("%vb", size), "-W", "y", "-y"}
 	for _, tag := range tags {
 		lvcreateArgs = append(lvcreateArgs, "--addtag")
@@ -326,11 +315,6 @@ func (t *ThinPool) Resize(ctx context.Context, newSize uint64) error {
 	if t.state.size == newSize {
 		return nil
 	}
-
-	if newSize%uint64(topolvm.MinimumSectorSize) != 0 {
-		return ErrNoMultipleOfSectorSize
-	}
-
 	if err := callLVM(ctx, "lvresize", "-f", "-L", fmt.Sprintf("%vb", newSize), t.state.fullName); err != nil {
 		return err
 	}


Test patch:
diff --git a/.github/workflows/e2e-k8s-incluster-lvmd.yaml b/.github/workflows/e2e-k8s-incluster-lvmd.yaml
index bb8c18f3..50d8362d 100644
--- a/.github/workflows/e2e-k8s-incluster-lvmd.yaml
+++ b/.github/workflows/e2e-k8s-incluster-lvmd.yaml
@@ -30,15 +30,6 @@ jobs:
           go-version-file: "go.mod"
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
-      - name: cache go dependencies
-        uses: actions/cache@v4
-        with:
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-          key: go-${{ hashFiles('go.sum', 'Makefile', 'versions.mk') }}
-          restore-keys: |
-            go-
       - name: cache e2e sidecar binaries
         uses: actions/cache@v4
         with:
diff --git a/.github/workflows/e2e-k8s-workflow.yaml b/.github/workflows/e2e-k8s-workflow.yaml
index 4074b392..df11dd36 100644
--- a/.github/workflows/e2e-k8s-workflow.yaml
+++ b/.github/workflows/e2e-k8s-workflow.yaml
@@ -23,15 +23,6 @@ jobs:
       - uses: actions/setup-go@v5
         with:
           go-version-file: "go.mod"
-      - name: cache go dependencies
-        uses: actions/cache@v4
-        with:
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-          key: go-${{ hashFiles('go.sum', 'Makefile', 'versions.mk') }}
-          restore-keys: |
-            go-
       - uses: actions/cache/restore@v4
         with:
           path: |
diff --git a/.github/workflows/e2e-k8s.yaml b/.github/workflows/e2e-k8s.yaml
index 2b8b184a..b0f6da9d 100644
--- a/.github/workflows/e2e-k8s.yaml
+++ b/.github/workflows/e2e-k8s.yaml
@@ -21,15 +21,6 @@ jobs:
           go-version-file: "go.mod"
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
-      - name: cache go dependencies
-        uses: actions/cache@v4
-        with:
-          path: |
-            ~/go/pkg/mod
-            ~/.cache/go-build
-          key: go-${{ hashFiles('go.sum', 'Makefile', 'versions.mk') }}
-          restore-keys: |
-            go-
       - name: cache e2e sidecar binaries
         uses: actions/cache@v4
         with:
diff --git a/internal/driver/controller_test.go b/internal/driver/controller_test.go
index b605fe17..cde27f6d 100644
--- a/internal/driver/controller_test.go
+++ b/internal/driver/controller_test.go
@@ -1,10 +1,7 @@
 package driver
 
 import (
-	"fmt"
 	"testing"
-
-	"github.com/topolvm/topolvm"
 )
 
 func Test_convertRequestCapacityBytes(t *testing.T) {
@@ -32,22 +29,13 @@ func Test_convertRequestCapacityBytes(t *testing.T) {
 		t.Error("should report capacity limit exceeded")
 	}
 
-	v, err := convertRequestCapacityBytes(0, topolvm.MinimumSectorSize-1)
-	if err == nil {
-		t.Error("should be error")
-	}
-	if err.Error() != "requested capacity is 0, because it defaulted to the limit (4095) and was rounded down to the nearest sector size (4096). specify the limit to be at least 4096 bytes" {
-		t.Errorf("should error if rounded-down limit is 0: %d", v)
-	}
-
-	v, err = convertRequestCapacityBytes(0, topolvm.MinimumSectorSize+1)
+	v, err := convertRequestCapacityBytes(0, 10)
 	if err != nil {
 		t.Error("should not be error")
 	}
-	if v != topolvm.MinimumSectorSize {
-		t.Errorf("should be nearest rounded down multiple of sector size if 0 is supplied and limit is larger than sector-size: %d", v)
+	if v != 10 {
+		t.Errorf("should be the limit capacity by default if 0 is supplied and limit is smaller than 1Gi: %d", v)
 	}
-
 	v, err = convertRequestCapacityBytes(0, 2<<30)
 	if err != nil {
 		t.Error("should not be error")
@@ -60,7 +48,7 @@ func Test_convertRequestCapacityBytes(t *testing.T) {
 	if err != nil {
 		t.Error("should not be error")
 	}
-	if v != topolvm.MinimumSectorSize {
+	if v != 1 {
 		t.Errorf("should be resolve capacities < 1Gi without error if there is no limit: %d", v)
 	}
 
@@ -72,51 +60,19 @@ func Test_convertRequestCapacityBytes(t *testing.T) {
 		t.Errorf("should be 1073741824 in byte precision: %d", v)
 	}
 
-	_, err = convertRequestCapacityBytes(1<<30+1, 1<<30+1)
-	if err == nil {
-		t.Error("should be error")
-	}
-	if err.Error() != "requested capacity rounded to nearest sector size (4096) exceeds limit capacity, either specify a lower request or a higher limit: request=1073745920 limit=1073741825" {
-		t.Error("should report capacity limit exceeded after rounding")
-	}
-
-	v, err = convertRequestCapacityBytes(0, 0)
+	v, err = convertRequestCapacityBytes(1<<30+1, 1<<30+1)
 	if err != nil {
 		t.Error("should not be error")
 	}
-	if v != 1<<30 {
+	if v != (1<<30)+1 {
 		t.Errorf("should be 1073741825 in byte precision: %d", v)
 	}
 
-	v, err = convertRequestCapacityBytes(1, topolvm.MinimumSectorSize*2)
+	v, err = convertRequestCapacityBytes(0, 0)
 	if err != nil {
 		t.Error("should not be error")
 	}
-	if v != topolvm.MinimumSectorSize {
-		t.Errorf("should be %d in byte precision: %d", topolvm.MinimumSectorSize, v)
-	}
-
-}
-
-func Test_roundUp(t *testing.T) {
-	testCases := []struct {
-		size     int64
-		multiple int64
-		expected int64
-	}{
-		{12, 4, 12},
-		{11, 4, 12},
-		{13, 4, 16},
-		{0, 4, 0},
-	}
-
-	for _, tc := range testCases {
-		name := fmt.Sprintf("nearest rounded up multiple of %d from %d should be %d", tc.multiple, tc.size, tc.expected)
-		t.Run(name, func(t *testing.T) {
-			rounded := roundUp(tc.size, tc.multiple)
-			if rounded != tc.expected {
-				t.Errorf("%s, but was %d", name, rounded)
-			}
-		})
+	if v != 1<<30 {
+		t.Errorf("should be 1073741825 in byte precision: %d", v)
 	}
 }
diff --git a/internal/lvmd/command/lvm_command_test.go b/internal/lvmd/command/lvm_command_test.go
index c78185c2..1848a9d8 100644
--- a/internal/lvmd/command/lvm_command_test.go
+++ b/internal/lvmd/command/lvm_command_test.go
@@ -2,7 +2,6 @@ package command
 
 import (
 	"context"
-	"errors"
 	"fmt"
 	"io"
 	"os"
@@ -11,9 +10,6 @@ import (
 
 	"github.com/go-logr/logr/funcr"
 	"github.com/go-logr/logr/testr"
-	"github.com/topolvm/topolvm"
-	"github.com/topolvm/topolvm/internal/lvmd/testutils"
-	ctrl "sigs.k8s.io/controller-runtime"
 	"sigs.k8s.io/controller-runtime/pkg/log"
 )
 
@@ -117,48 +113,4 @@ func Test_lvm_command(t *testing.T) {
 			t.Fatalf("version from stdout was not logged, existing logs: %v", messages)
 		}
 	})
-
-	t.Run("lv creation", func(t *testing.T) {
-		ctx := ctrl.LoggerInto(context.Background(), testr.New(t))
-		vgName := "lvm_command_test"
-		loop, err := testutils.MakeLoopbackDevice(ctx, vgName)
-		if err != nil {
-			t.Fatal(err)
-		}
-
-		err = testutils.MakeLoopbackVG(ctx, vgName, loop)
-		if err != nil {
-			t.Fatal(err)
-		}
-		defer testutils.CleanLoopbackVG(vgName, []string{loop}, []string{vgName})
-
-		vg, err := FindVolumeGroup(ctx, vgName)
-		if err != nil {
-			t.Fatal(err)
-		}
-
-		t.Run("create volume with multiple of Sector Size is fine", func(t *testing.T) {
-			err = vg.CreateVolume(ctx, "test1", uint64(topolvm.MinimumSectorSize), []string{"tag"}, 0, "", nil)
-			if err != nil {
-				t.Fatal(err)
-			}
-			vol, err := vg.FindVolume(ctx, "test1")
-			if err != nil {
-				t.Fatal(err)
-			}
-			if vol.Size()%uint64(topolvm.MinimumSectorSize) != 0 {
-				t.Fatalf("expected size to be multiple of sector size %d, got %d", uint64(topolvm.MinimumSectorSize), vol.Size())
-			}
-			if err := vg.RemoveVolume(ctx, "test1"); err != nil {
-				t.Fatal(err)
-			}
-		})
-
-		t.Run("create volume with size not multiple of sector Size to get rejected", func(t *testing.T) {
-			err = vg.CreateVolume(ctx, "test1", uint64(topolvm.MinimumSectorSize)+1, []string{"tag"}, 0, "", nil)
-			if !errors.Is(err, ErrNoMultipleOfSectorSize) {
-				t.Fatalf("expected error to be %v, got %v", ErrNoMultipleOfSectorSize, err)
-			}
-		})
-	})
 }