Skip to content

✨ Use docker API instead of exec'ing docker cmds #4413

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

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ providers = {
],
"additional_docker_helper_commands": """
RUN wget -qO- https://dl.k8s.io/v1.21.2/kubernetes-client-linux-amd64.tar.gz | tar xvz
RUN wget -qO- https://get.docker.com | sh
""",
"additional_docker_build_commands": """
COPY --from=tilt-helper /usr/bin/docker /usr/bin/docker
COPY --from=tilt-helper /go/kubernetes/client/bin/kubectl /usr/bin/kubectl
""",
},
Expand Down
12 changes: 9 additions & 3 deletions test/framework/docker_logcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ func (k DockerLogCollector) collectLogsFromNode(ctx context.Context, outputPath
return err
}
defer f.Close()
return containerRuntime.ExecToFile(ctx, containerName, f, command, args...)
execConfig := container.ExecContainerInput{
OutputBuffer: f,
}
return containerRuntime.ExecContainer(ctx, containerName, &execConfig, command, args...)
}
}
copyDirFn := func(containerDir, dirName string) func() error {
Expand All @@ -90,10 +93,13 @@ func (k DockerLogCollector) collectLogsFromNode(ctx context.Context, outputPath

defer os.Remove(tempfileName)

err = containerRuntime.ExecToFile(
execConfig := container.ExecContainerInput{
OutputBuffer: f,
}
err = containerRuntime.ExecContainer(
ctx,
containerName,
f,
&execConfig,
"tar", "--hard-dereference", "--dereference", "--directory", containerDir, "--create", "--file", "-", ".",
)
if err != nil {
Expand Down
Loading