Update submit.go
Refactor slightly to be clearer that we only add .gz if it's not already there. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
parent
8e842a3fc2
commit
ac76e5e706
1 changed files with 3 additions and 4 deletions
|
@ -438,10 +438,9 @@ func saveLogPart(logNum int, filename string, reader io.Reader, reportDir string
|
|||
// Either way, we need to append .gz, because we're compressing it.
|
||||
var leafName string
|
||||
if logRegexp.MatchString(filename) {
|
||||
if strings.HasSuffix(filename, ".gz") {
|
||||
leafName = filename
|
||||
} else {
|
||||
leafName = filename + ".gz"
|
||||
if !strings.HasSuffix(filename, ".gz") {
|
||||
leafName += ".gz"
|
||||
}
|
||||
} else {
|
||||
leafName = fmt.Sprintf("logs-%04d.log.gz", logNum)
|
||||
|
|
Reference in a new issue