mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-19 04:06:24 +00:00
Record scp command failure message to help debugging
This commit is contained in:
@@ -159,9 +159,13 @@ func (ins *Instance) PushFile(srcPath, destPath string) error {
|
||||
if ins.ExternalIP == "" {
|
||||
ins.populateExternalIP()
|
||||
}
|
||||
return exec.Command("scp", "-o", "StrictHostKeyChecking no",
|
||||
output, err := exec.Command("scp", "-o", "StrictHostKeyChecking no",
|
||||
"-i", ins.SshKey,
|
||||
srcPath, fmt.Sprintf("%s@%s:%s", ins.SshUser, ins.ExternalIP, destPath)).Run()
|
||||
srcPath, fmt.Sprintf("%s@%s:%s", ins.SshUser, ins.ExternalIP, destPath)).CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error running scp: %v.\nHere is the output for the command: %v", err, string(output))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteInstance deletes a GCE instance.
|
||||
|
||||
Reference in New Issue
Block a user