Fix debug bundle panic on Windows (#14399)
* Fix debug bundle panic on Windows * Add changelog entry
This commit is contained in:
parent
1bd49383cd
commit
0f42131350
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
debug: Fix panic when capturing debug bundle on Windows
|
||||
```
|
|
@ -349,7 +349,7 @@ func (c *DebugCommand) generateIndex() error {
|
|||
|
||||
dir, file := filepath.Split(relPath)
|
||||
if len(dir) != 0 {
|
||||
dir = strings.TrimSuffix(dir, "/")
|
||||
dir = filepath.Clean(dir)
|
||||
filesArr := outputLayout[dir].(map[string]interface{})["files"]
|
||||
outputLayout[dir].(map[string]interface{})["files"] = append(filesArr.([]string), file)
|
||||
} else {
|
||||
|
@ -448,7 +448,7 @@ func (c *DebugCommand) preflight(rawArgs []string) (string, error) {
|
|||
}
|
||||
|
||||
// Strip trailing slash before proceeding
|
||||
c.flagOutput = strings.TrimSuffix(c.flagOutput, "/")
|
||||
c.flagOutput = filepath.Clean(c.flagOutput)
|
||||
|
||||
// If compression is enabled, trim the extension so that the files are
|
||||
// written to a directory even if compression somehow fails. We ensure the
|
||||
|
|
Loading…
Reference in New Issue