Don't append a second .gz
extension
This commit is contained in:
parent
d337ec9843
commit
523333f5a0
1 changed files with 5 additions and 1 deletions
|
@ -438,7 +438,11 @@ func saveLogPart(logNum int, filename string, reader io.Reader, reportDir string
|
||||||
// Either way, we need to append .gz, because we're compressing it.
|
// Either way, we need to append .gz, because we're compressing it.
|
||||||
var leafName string
|
var leafName string
|
||||||
if logRegexp.MatchString(filename) {
|
if logRegexp.MatchString(filename) {
|
||||||
|
if strings.HasSuffix(filename, ".gz") {
|
||||||
|
leafName = filename
|
||||||
|
} else {
|
||||||
leafName = filename + ".gz"
|
leafName = filename + ".gz"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
leafName = fmt.Sprintf("logs-%04d.log.gz", logNum)
|
leafName = fmt.Sprintf("logs-%04d.log.gz", logNum)
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue