Skip to content

Commit

Permalink
fix(build): Cross Build enviroment bug fixes (#264)
Browse files Browse the repository at this point in the history
- Adding typecasting to make compilation work under MAC build environment

- Using go env variable instead of uname for determining platform

Signed-off-by: praveengt <praveen.gt@flipkart.com>
  • Loading branch information
praveengt authored and pawanpraka1 committed Dec 21, 2020
1 parent 2906d39 commit c037fdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
14 changes: 2 additions & 12 deletions buildscripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
exit 1
fi

if [ "$UNAME" = "Darwin" ] ; then
XC_OS="darwin"
elif [ "$UNAME" = "Linux" ] ; then
XC_OS="linux"
fi


if [ -z "${PNAME}" ];
then
echo "Project name not defined"
Expand All @@ -90,11 +83,8 @@ echo "==> Removing old directory..."
rm -rf bin/${PNAME}/*
mkdir -p bin/${PNAME}/

# If its dev mode, only build for ourself
if [[ "${DEV}" ]]; then
XC_OS=$(go env GOOS)
XC_ARCH=$(go env GOARCH)
fi
XC_OS=$(go env GOOS)
XC_ARCH=$(go env GOARCH)

# Build!
echo "==> Building ${CTLNAME} using $(go version)... "
Expand Down
6 changes: 3 additions & 3 deletions pkg/driver/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ func (ns *node) NodeGetVolumeStats(
var usage []*csi.VolumeUsage
usage = append(usage, &csi.VolumeUsage{
Unit: csi.VolumeUsage_BYTES,
Total: int64(sfs.Blocks) * sfs.Bsize,
Used: int64(sfs.Blocks-sfs.Bfree) * sfs.Bsize,
Available: int64(sfs.Bavail) * sfs.Bsize,
Total: int64(sfs.Blocks) * int64(sfs.Bsize),
Used: int64(sfs.Blocks-sfs.Bfree) * int64(sfs.Bsize),
Available: int64(sfs.Bavail) * int64(sfs.Bsize),
})
usage = append(usage, &csi.VolumeUsage{
Unit: csi.VolumeUsage_INODES,
Expand Down

0 comments on commit c037fdf

Please sign in to comment.