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

Add k3s WithManifest option #1920

Merged

Conversation

pablochacin
Copy link
Contributor

What does this PR do?

Add an option to k3s to pre-load manifest in the cluster to create resources needed by the test.

Why is it important?

Improve user experience

Related issues

Closes #1915

Copy link

netlify bot commented Nov 15, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit eb1d29f
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/65e7440cda0d4b0008282bcb
😎 Deploy Preview https://deploy-preview-1920--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya
Copy link
Collaborator

@pablochacin I think this PR can be continued, as the ready lifecycle hook was added in v0.28.0

Thanks!

Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@pablochacin pablochacin changed the title WIP: Add k3s WithManifest option Add k3s WithManifest option Mar 2, 2024
@pablochacin pablochacin marked this pull request as ready for review March 2, 2024 19:00
@pablochacin pablochacin requested a review from a team as a code owner March 2, 2024 19:00
@pablochacin
Copy link
Contributor Author

Hi @mdelapenya I updated the PR and think it is ready for review.

modules/k3s/k3s.go Outdated Show resolved Hide resolved
pablochacin and others added 2 commits March 5, 2024 17:06
Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@mdelapenya mdelapenya self-assigned this Mar 5, 2024
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Mar 5, 2024
Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!!

@mdelapenya mdelapenya merged commit 85361fe into testcontainers:main Mar 5, 2024
96 checks passed
@mdelapenya
Copy link
Collaborator

@pablochacin I noticed 3 security issues reported by Sonar (only seen on merge commits):

  1. Set automountServiceAccountToken to false for this specification of kind Pod. https://sonarcloud.io/project/issues?open=AY4PijERsc7uXOtG2LaZ&id=testcontainers_testcontainers-go
  2. Specify a CPU limit for this container. https://sonarcloud.io/project/issues?open=AY4PijERsc7uXOtG2LaX&id=testcontainers_testcontainers-go
  3. Specify a memory limit for this container. https://sonarcloud.io/project/issues?open=AY4PijERsc7uXOtG2LaY&id=testcontainers_testcontainers-go

Given this is a deployment manifest for tests only, I'd skip them, but wanted to double check with you first.

@pablochacin
Copy link
Contributor Author

Yes, this is only for testing on a test cluster, it's not going to hit any production or even live cluster.
I don't think any of those are relevant. They could be easily fixed but not sure it worth doing it, unless the sonar report keeps bothering you.

mdelapenya added a commit to JJCinAZ/testcontainers-go that referenced this pull request Mar 13, 2024
* main: (239 commits)
  Move the container and config tests into a test package (testcontainers#2242)
  Added error handling for context.Canceled in log reading code (testcontainers#2268)
  chore: updated docker compose version (testcontainers#2340)
  Add method for getting Weaviate's gRPC port (testcontainers#2339)
  chore: use withEnv in localstack module (testcontainers#2337)
  docs: fix wrong copy&paste (testcontainers#2338)
  fix: consul race on HTTP port (testcontainers#2336)
  chore(deps): bump mkdocs-material from 8.2.7 to 9.5.13 (testcontainers#2334)
  feat: add openfga module (testcontainers#2332)
  chore: retire dependabot (testcontainers#2325)
  chore: check that the new version is not empty (testcontainers#2331)
  chore: prepare for next minor development cycle (0.30.0)
  chore: use new version (v0.29.1) in modules and examples
  fix: incorrect version
  chore: prepare for next minor development cycle ()
  chore: use new version (v0.29.0) in modules and examples
  generic.go: GenericContainer(): clearer error message (testcontainers#2327)
  chore: confirm support for new mongo images (testcontainers#2326)
  Add k3s WithManifest option (testcontainers#1920)
  chore(deps): bump google.golang.org/grpc in /modules/qdrant (testcontainers#2281)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add option to k3s to preload manifests into the container
2 participants