server: replace blob prefix separator from ':' to '-' (#3146)

This fixes issues with blob file names that contain ':' characters to be rejected by file systems that do not support them.
This commit is contained in:
Blake Mizerany
2024-03-14 20:18:06 -07:00
committed by GitHub
parent 6459377ae0
commit 703684a82a
6 changed files with 120 additions and 13 deletions

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"io"
"os"
"runtime"
"strings"
"golang.org/x/exp/slices"
@@ -47,10 +46,7 @@ func NewLayer(r io.Reader, mediatype string) (*Layer, error) {
return nil, err
}
delimiter := ":"
if runtime.GOOS == "windows" {
delimiter = "-"
}
const delimiter = "-"
pattern := strings.Join([]string{"sha256", "*-partial"}, delimiter)
temp, err := os.CreateTemp(blobs, pattern)