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

docklog: add go-plugin for forwarding of docker logs #4758

Merged
merged 2 commits into from
Oct 16, 2018

Conversation

nickethier
Copy link
Member

This PR implements a go-plugin for forwarding the logs of a docker container which will be launched by the docker task driver plugin.


// Docklog is a small utility to forward logs from a docker container to a target
// destination
type Docklog interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a huge fan of the name. Would call it DockerLogger


// NewDocklog returns an implementation of the Docklog interface
func NewDocklog(logger hclog.Logger) Docklog {
return &dockerLogger{logger: logger}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name the logger here, that has been the pattern elsewhere?

require.NoError(err)

var count int
for !container.State.Running {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could replace this with testutil.WaitForResult

count++
}

stdout := &noopCloser{bytes.NewBufferString("")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echoToContainer(t, client, container.ID, "abc")
echoToContainer(t, client, container.ID, "123")

time.Sleep(2000 * time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a long sleep, why not just rely on wait for result?

@nickethier nickethier merged commit b2ee955 into r-clientv2 Oct 16, 2018
@nickethier nickethier deleted the f-driver-plugin-docker branch October 16, 2018 18:28
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants