1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

Fix etcdbackup error reporting

This commit is contained in:
moelsayed
2019-01-25 00:56:51 +02:00
committed by Alena Prokharchyk
parent c73a58d45c
commit c229a0637d
2 changed files with 31 additions and 9 deletions

View File

@@ -485,3 +485,17 @@ func DoRestartContainer(ctx context.Context, dClient *client.Client, containerNa
log.Infof(ctx, "[restart/%s] Successfully restarted container on host [%s]", containerName, hostname)
return nil
}
func GetContainerOutput(ctx context.Context, dClient *client.Client, containerName, hostname string) (int64, string, string, error) {
status, err := WaitForContainer(ctx, dClient, hostname, containerName)
if err != nil {
return 1, "", "", err
}
stderr, stdout, err := GetContainerLogsStdoutStderr(ctx, dClient, containerName, "1", false)
if err != nil {
return 1, "", "", err
}
return status, stdout, stderr, nil
}