Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.3] 🐛 test/framework fix docker pod log collector #8644

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/framework/docker_logcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package framework

import (
"bytes"
"context"
"fmt"
"os"
Expand Down Expand Up @@ -106,8 +107,10 @@ func (k DockerLogCollector) collectLogsFromNode(ctx context.Context, outputPath

defer os.Remove(tempfileName)

var execErr string
execConfig := container.ExecContainerInput{
OutputBuffer: f,
ErrorBuffer: bytes.NewBufferString(execErr),
}
err = containerRuntime.ExecContainer(
ctx,
Expand All @@ -116,7 +119,7 @@ func (k DockerLogCollector) collectLogsFromNode(ctx context.Context, outputPath
"tar", "--hard-dereference", "--dereference", "--directory", containerDir, "--create", "--file", "-", ".",
)
if err != nil {
return err
return errors.Wrapf(err, execErr)
}

err = os.MkdirAll(outputDir, os.ModePerm)
Expand Down