Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mismatched types int64 and uint32 utils/osutils_linux.go #537

Closed
scaleoutsean opened this issue Feb 25, 2021 · 0 comments
Closed

mismatched types int64 and uint32 utils/osutils_linux.go #537

scaleoutsean opened this issue Feb 25, 2021 · 0 comments

Comments

@scaleoutsean
Copy link
Contributor

Just a small note for Trident enthusiasts who give this a try:

$ GOOS=linux GOARCH=s390x go build
....
# github.com/netapp/trident/utils
utils/osutils_linux.go:70:28: invalid operation: int64(buf.Blocks) * buf.Bsize (mismatched types int64 and uint32)
utils/osutils_linux.go:80:32: invalid operation: int64(buf.Bavail) * buf.Bsize (mismatched types int64 and uint32)

Environment

  • Trident source v21.01.1
  • Ubuntu Ubuntu 18.04.5 LTS (x86_64)
  • go version go1.16 linux/amd64

To Reproduce

Check out source code, install Go, replace gcr.io/distroless/static in 3 Dockerfiles with a link to gcr.io/distroless/static:latest-s390x, build for linux/s390x

Expected behavior

Trident build succeeds

Additional context

On the surface this change to utils/osutils_linux.go helps hide this issue, but I don't know how it impacts the resulting trident image (and have no way to test).

70c70
< 	size := int64(buf.Blocks) * buf.Bsize
---
> 	size := int64(buf.Blocks) * int64(buf.Bsize)
80c80
< 	available = int64(buf.Bavail) * buf.Bsize
---
> 	available = int64(buf.Bavail) * int64(buf.Bsize)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants