-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Add Redpanda module #743
Add Redpanda module #743
Conversation
✅ Deploy Preview for testcontainers-node ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for the contribution @stfnzl. Could you have a look at the failing tests? |
@cristianrgreco tests are failing on podman, which i'm not really familiar with. I installed podman and ran the test locally and they pass though... |
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.
Thanks for the contribution, @stfnzl ! I've left a few comments.
public getAdminAddress(): string { | ||
return `http://${this.getHost()}:${this.getMappedPort(REDPANDA_ADMIN_PORT)}`; | ||
} | ||
|
||
public getRestProxyAddress(): string { | ||
return `http://${this.getHost()}:${this.getMappedPort(REST_PROXY_PORT)}`; | ||
} |
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.
Can we please add some tests for those?
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.
Done
const client = await getContainerRuntimeClient(); | ||
const container = client.container.getById(inspectResult.name.substring(1)); | ||
const renderedRedpandaFile = path.join(os.tmpdir(), `redpanda-${container.id}.yaml`); | ||
fs.writeFileSync( | ||
renderedRedpandaFile, | ||
this.renderRedpandaFile(client.info.containerRuntime.host, inspectResult.ports[REDPANDA_PORT][0].hostPort) | ||
); | ||
const tar = archiver("tar"); | ||
tar.file(renderedRedpandaFile, { name: "/etc/redpanda/redpanda.yaml" }); | ||
tar.finalize(); | ||
await client.container.putArchive(container, tar, "/"); | ||
fs.unlinkSync(renderedRedpandaFile); |
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.
I think this can be replaced by using container.copyContentToContainer
. See kafka-container as a reference.
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.
Yes, I took a deeper look on how kafka
was implemented and adapted to use copyContentToContainer
This PR adds a Redpanda module.