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

Multiple docker sockets support #303

Merged

Conversation

amaelFr
Copy link
Contributor

@amaelFr amaelFr commented Oct 14, 2021

I tried to add an implementation for multiple docker sockets, related to the problem I opened on the topic.

I used your implementation and only changed the docker client to an array (and associated variables like jump events).

Could you please take a look at it, if it meets your principles?

Thanks

plugin/loader.go Outdated
wrappedClient := docker.WrapClient(dockerClient)

dockerClients = append(dockerClients, wrappedClient)
skipEvents = append(skipEvents, true)
Copy link
Owner

Choose a reason for hiding this comment

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

It seems that the old code initialized skipEvents as false instead of true.
Are you intentionally changing this?
Should we change this line to false?

@lucaslorentz
Copy link
Owner

@amaelFr code looks good and integration tests are passing
I just had one question, can you please check?

plugin/loader.go Outdated
wrappedClient := docker.WrapClient(dockerClient)

dockerClients = append(dockerClients, wrappedClient)
skipEvents = append(skipEvents, true)
Copy link
Owner

Choose a reason for hiding this comment

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

Same thing here, should it be false instead of true?

@amaelFr
Copy link
Contributor Author

amaelFr commented Oct 30, 2021

After several searches, it appears to be an error in my code, but it is mitigated by calling the update function further down in the code.

The two instance of `append' could be replace by a line of code like

dockerLoader.skipEvents = make([]bool, len(dockerLoader.dockerClients))

Do you want me to update the code ?

@lucaslorentz
Copy link
Owner

Do you want me to update the code ?

Yes, sure. The one line instead of 2 appends seems better.

@amaelFr
Copy link
Contributor Author

amaelFr commented Nov 9, 2021

I have updated the part of the code concerned by your review.

@lucaslorentz lucaslorentz merged commit c23132b into lucaslorentz:master Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants