linode / linode-blockstorage-csi-driver

Container Storage Interface (CSI) Driver for Linode Block Storage
Apache License 2.0
66 stars 55 forks source link

adding windows build tags to hide unix.Statfs calls #127

Closed luthermonson closed 1 year ago

luthermonson commented 1 year ago

Getting NodeGetVolumeStats implemented added a dependency to golang.org/x/sys/unix which will never work on windows nodes. This driver does NOT support Windows nodes but this does make running the unit tests on a windows desktop work and as an open source project we should acknowledge development may happen on any platform.

Running TestDriverSuite on a win11 desktop from Goland

Before changes:

# github.com/linode/linode-blockstorage-csi-driver/pkg/linode-bs [github.com/linode/linode-blockstorage-csi-driver/pkg/linode-bs.test]
.\nodeserver.go:392:18: undefined: unix.Statfs_t
.\nodeserver.go:394:14: undefined: unix.Statfs
.\nodeserver.go:396:26: undefined: unix.ENOENT

After changes:

=== RUN   TestDriverSuite
--- PASS: TestDriverSuite (0.00s)
PASS