daemon: rename max/min as it collides with go1.21 builtin

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-08-26 19:39:52 +02:00
parent 318b3d4fe5
commit a3867992b7
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 4 additions and 4 deletions

View file

@ -406,7 +406,7 @@ func (b *limitedBuffer) Write(data []byte) (int, error) {
bufLen := b.buf.Len()
dataLen := len(data)
keep := min(maxOutputLen-bufLen, dataLen)
keep := minInt(maxOutputLen-bufLen, dataLen)
if keep > 0 {
b.buf.Write(data[:keep])
}
@ -436,7 +436,7 @@ func timeoutWithDefault(configuredValue time.Duration, defaultValue time.Duratio
return configuredValue
}
func min(x, y int) int {
func minInt(x, y int) int {
if x < y {
return x
}

View file

@ -18,8 +18,8 @@ func (i *ImageService) GetContainerLayerSize(ctx context.Context, containerID st
// GetLayerFolders returns the layer folders from an image RootFS
func (i *ImageService) GetLayerFolders(img *image.Image, rwLayer layer.RWLayer) ([]string, error) {
folders := []string{}
max := len(img.RootFS.DiffIDs)
for index := 1; index <= max; index++ {
rd := len(img.RootFS.DiffIDs)
for index := 1; index <= rd; index++ {
// FIXME: why does this mutate the RootFS?
img.RootFS.DiffIDs = img.RootFS.DiffIDs[:index]
if !system.IsOSSupported(img.OperatingSystem()) {