mirror of
https://github.com/containers/podman.git
synced 2025-06-17 06:57:43 +08:00
Fix machine volumes with long path and paths with dashes
AppleHV accepts a max 36 bytes for mount tags. Instead of using the fully qualified path for the mount tag, SHA256 the path, and truncate the shasum to 36 bytes. Also correctly escape dashes in mounted paths. Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
@ -932,3 +932,9 @@ func (f *UnitFile) GetTemplateParts() (string, string) {
|
||||
}
|
||||
return parts[0] + "@" + ext, parts[1]
|
||||
}
|
||||
|
||||
func PathEscape(path string) string {
|
||||
var escaped strings.Builder
|
||||
escapeString(&escaped, path, true)
|
||||
return escaped.String()
|
||||
}
|
||||
|
Reference in New Issue
Block a user