fix issue where rootfs path strips to the empty string (#1464)

Change-type: patch
Connects-to: #1463
Signed-off-by: dt-rush <nickp@balena.io>
This commit is contained in:
dt-rush 2019-09-09 11:39:25 -04:00 committed by Ben Kochie
commit 93fbb93a46
4 changed files with 8 additions and 1 deletions

View file

@ -44,5 +44,9 @@ func rootfsStripPrefix(path string) string {
if *rootfsPath == "/" {
return path
}
return strings.TrimPrefix(path, *rootfsPath)
stripped := strings.TrimPrefix(path, *rootfsPath)
if stripped == "" {
return "/"
}
return stripped
}