fixed string replace

Signed-off-by: Wayne Cheng <zhengwei@tiduyun.com>
This commit is contained in:
Wayne Cheng 2024-01-06 22:03:17 +08:00
parent c2919580b6
commit 46b474267b
1 changed files with 4 additions and 4 deletions

View File

@ -170,13 +170,13 @@ func manifestToFilename(root, manifestList, manifest string) string {
}
func makeFilesafeName(ref string) string {
fileName := strings.ReplaceAll(ref, ":", "--")
return strings.ReplaceAll(fileName, "/", "__")
fileName := strings.ReplaceAll(ref, ":", "%")
return strings.ReplaceAll(fileName, "/", "#")
}
func filenameToRefString(filename string) string {
refString := strings.ReplaceAll(filename, "--", ":")
return strings.ReplaceAll(refString, "__", "/")
refString := strings.ReplaceAll(filename, "%", ":")
return strings.ReplaceAll(refString, "#", "/")
}
type notFoundError struct {