mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-23 21:05:00 +00:00
PT-2169 - pt-k8s-debug-collector integration of pg_gather requires croping first line of the output file (#615)
* PT-2169 - pt-k8s-debug-collector integration of pg_gather requires croping first line of the output file Modified pt-k8s-debug-collector so it redirects only STDOUT to summary.txt STDERR is stored in the logs and recorded in summary.txt only if summary fails with the error Modified Makefile, so it does not include closing bracket into the version string Created test case for the fix * PT-2169 - pt-k8s-debug-collector integration of pg_gather requires croping first line of the output Removed else as requested by Ege
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"compress/gzip"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -309,7 +308,7 @@ func (d *Dumper) getResource(name, namespace string, ignoreNotFound bool, tw *ta
|
||||
}
|
||||
|
||||
func (d *Dumper) logError(err string, args ...string) {
|
||||
d.errors += d.cmd + " " + strings.Join(args, " ") + ": " + err + "\n"
|
||||
d.errors += d.cmd + " " + strings.Join(args, " ") + "\n" + err + "\n\n"
|
||||
}
|
||||
|
||||
func addToArchive(location string, mode int64, content []byte, tw *tar.Writer) error {
|
||||
@@ -463,10 +462,9 @@ func (d *Dumper) getPodSummary(resource, podName, crName string, namespace strin
|
||||
cmd.Stderr = &errb
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return nil, errors.Errorf("error: %v, stderr: %s, stdout: %s", err, errb.String(), outb.String())
|
||||
return nil, errors.Errorf("error: %v\nstderr: %sstdout: %s", err, errb.String(), outb.String())
|
||||
}
|
||||
|
||||
return []byte(fmt.Sprintf("stderr: %s, stdout: %s", errb.String(), outb.String())), nil
|
||||
return outb.Bytes(), nil
|
||||
}
|
||||
|
||||
func (d *Dumper) getCR(crName string, namespace string) (crSecrets, error) {
|
||||
|
Reference in New Issue
Block a user