-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Support Kraft mode for Kafka container #723
Conversation
✅ Deploy Preview for testcontainers-node ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hey @cristianrgreco , fixed all the problems. Now the PR is ready for review. |
Thanks @silh, could you please also add an example to the Kafka docs showing how to use Kraft with the KafkaContainer? |
@cristianrgreco done 👍 |
const boundPorts = BoundPorts.fromInspectResult(client.info.containerRuntime.hostIps, inspectResult).filter( | ||
this.exposedPorts | ||
); | ||
await waitForContainer(client, dockerContainer, this.originalWaitinStrategy, boundPorts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is different, to manually invoke a wait strategy after a container is said to have started. Ideally we should get this working just by setting this.waitStrategy
and nothing else. E.g would it work if on line 139 we do
this.waitStrategy = Wait.forAll([
this.waitStrategy,
Wait.forLogMessage(WAIT_FOR_SCRIPT_MESSAGE)
]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work unfortunately.
The main problem is we need to gather some info which is only available in when container is started and copy it to the container. Unlike the java implementation, some of this methods are not available on not-started container. It can be achieved, but the code will be messier and will have some duplicated functionality. I'll try to prepare a commit with that implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we can look at this some other time. For now I think it's more important to add support for Kraft
Kraft is out of beta for some time now and and soon zookeeper support will be completely removed so it's useful to prepare for kraft support. It was also possible to use testcontainers-java without Zookeeper since 1.18.0.
This PR ports the solution to enable usage of Kafka without Zookeeper from testcontainers-java.
Unrelated changes:
copyContentToContainer
not setting the correct mode for the file inside the container.