Skip to content

Commit 786aeec

Browse files
committed
Fix build on 32bit
The constant math.MaxUint32 has no type specified. Golang tries to cast it to int, which crashes the assembly on 32 bit architectures.
1 parent 22c659d commit 786aeec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/hostpath/controllerserver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ func (hp *hostPath) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReq
653653
ulenSnapshots = int32(len(snapshots))
654654
maxEntries = req.MaxEntries
655655
startingToken int32
656+
maxToken = uint32(math.MaxUint32)
656657
)
657658

658659
if v := req.StartingToken; v != "" {
@@ -661,7 +662,7 @@ func (hp *hostPath) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReq
661662
return nil, status.Errorf(
662663
codes.Aborted,
663664
"startingToken=%d !< int32=%d",
664-
startingToken, math.MaxUint32)
665+
startingToken, maxToken)
665666
}
666667
startingToken = int32(i)
667668
}

0 commit comments

Comments
 (0)