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

K3s Module #212

Open
nemoo opened this issue Feb 20, 2022 · 6 comments
Open

K3s Module #212

nemoo opened this issue Feb 20, 2022 · 6 comments

Comments

@nemoo
Copy link

nemoo commented Feb 20, 2022

Not an issue but more of a question.

testcontainers-java now features a module for lightweight Kubernetes clusters called K3s: https://github.com/testcontainers/testcontainers-java/blob/master/modules/k3s/src/main/java/org/testcontainers/k3s/K3sContainer.java

The module documentation can be found here: https://www.testcontainers.org/modules/k3s/

Will this module also be wrapped in testcontainers-scala?

@dimafeng
Copy link
Collaborator

Hi @nemoo, thank you for your question! This project is driven by the community and java modules are getting added to the scala version as the community needs it.

If you'd like to contribute support for this module, it would be huge help for this project!

@nemoo
Copy link
Author

nemoo commented Feb 21, 2022

Great, I will give it a go.

Is there a contribution guide? When I tried sbt publishLocal it only created the scala 2.12 versions, not the scala 2.13 version.

Edit: ok for testing I now set the scala version explicitly via ++ 2.13.6 publishLocal

@dimafeng
Copy link
Collaborator

Sorry, unfortunately I don't have a contribution guide but you can check out several recent PRs that add support for various containers:
https://github.com/testcontainers/testcontainers-scala/pull/126/files
https://github.com/testcontainers/testcontainers-scala/pull/211/files
https://github.com/testcontainers/testcontainers-scala/pull/208/files

@nemoo
Copy link
Author

nemoo commented Mar 3, 2022

This requires also a bump to testcontainers java 1.16.3. I guess that would be a different pull request?

@nemoo
Copy link
Author

nemoo commented Mar 3, 2022

Also, in the original java k3s module test, a special log consumer Slf4jLogConsumer is used:
https://github.com/testcontainers/testcontainers-java/blob/master/modules/k3s/src/test/java/org/testcontainers/k3s/OfficialClientK3sContainerTest.java

K3sContainer k3s = new K3sContainer(DockerImageName.parse("rancher/k3s:v1.21.3-k3s1"))
                .withLogConsumer(new Slf4jLogConsumer(log))

Do we have any examples on how the use of .withLogConsumer() should be ported over to scala?

@dimafeng
Copy link
Collaborator

dimafeng commented Mar 3, 2022

This requires also a bump to testcontainers java 1.16.3. I guess that would be a different pull request?

It's fine if you bump it here

Do we have any examples on how the use of .withLogConsumer() should be ported over to scala?

I think it'd look like this:

case class K3sContainer(
  
  logConsumer: Slf4jLogConsumer 
) {
...
c.withLogConsumer(logConsumer)
...
}

example https://github.com/testcontainers/testcontainers-scala/pull/126/files#diff-19e736fb3cde3f8c030b9fc3639026ec28e9bd61c8caa82096dfeb69e9f918f3R29

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

No branches or pull requests

2 participants