metal-stack / csi-driver-lvm

MIT License
121 stars 26 forks source link

Support arm64 and arm arch container images #38

Closed brlbil closed 3 years ago

brlbil commented 3 years ago

It would be great if arm64 and arm container images are build and pushed to the registry.

Gerrit91 commented 3 years ago

Hi! Thanks for opening the issue. :)

We would be glad to see a PR for that because for us it will be hard to verify since we do not have arm64 archs.

brlbil commented 3 years ago

The good news the code can be compiled to arm7 and arm64 with a tiny change.

One problem is I do not have much experience with the make tool and another issue would should all the supported platforms be part of the CI/CD? I might do the initial testing and modification if time allowed, but I do not know how to add arm hardware for CI/CD if it is required.

majst01 commented 3 years ago

What are the required code changes to make it compile under arm7/arm64 ?

brlbil commented 3 years ago
diff --git a/pkg/lvm/nodeserver.go b/pkg/lvm/nodeserver.go
index 7a8f2fa..2efc2b4 100644
--- a/pkg/lvm/nodeserver.go
+++ b/pkg/lvm/nodeserver.go
@@ -269,8 +269,8 @@ func (ns *nodeServer) NodeGetVolumeStats(ctx context.Context, in *csi.NodeGetVol
                return nil, err
        }

-       diskFree := int64(fs.Bfree) * fs.Bsize
-       diskTotal := int64(fs.Blocks) * fs.Bsize
+       diskFree := int64(fs.Bfree) * int64(fs.Bsize)
+       diskTotal := int64(fs.Blocks) * int64(fs.Bsize)

        inodesFree := int64(fs.Ffree)
        inodesTotal := int64(fs.Files)
majst01 commented 3 years ago

This can only be true for arm7, because im almost sure on arm64 fs.Bsize is int64 already.

brlbil commented 3 years ago

That is true. The wording is not precise since the issue is to support both arm64 and arm (arm7).

majst01 commented 3 years ago

If you mind sending a PR, im happy to review

brlbil commented 3 years ago

Hi, there have sent a PR, anyone up for a review?

brlbil commented 3 years ago

Hi The latest tagged v0.4.0 images do not have arm nor arm64 images available. Only the latest tag had them lvmplugin tags