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:
parent
ab8cf1f718
commit
93fbb93a46
4 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue