-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Added CopyFileFromContainer to DockerContainer #347
Added CopyFileFromContainer to DockerContainer #347
Conversation
…les from a container
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 this contribution @codepitbull, this LGTM!
As a follow-up, would you see it doable to contribute an implementation to the compose provider? 🤔 |
Codecov Report
@@ Coverage Diff @@
## master #347 +/- ##
==========================================
+ Coverage 61.53% 62.11% +0.58%
==========================================
Files 15 15
Lines 993 1011 +18
==========================================
+ Hits 611 628 +17
+ Misses 290 286 -4
- Partials 92 97 +5
Continue to review full report at Codecov.
|
I will checxk to add it to the ComposeProvider |
About the Compose Part: There are no containers exposed. |
Sure thing. I can create an issue to add the support to the compose provider. Meanwhile, this LGTM |
Hello! Thank you for your contribution! I had a chat with @mdelapenya via Slack and I would like to know what you think about this:
I see how your function will may come from what we have done with I think the right signature should be:
This works a bit better over the network and it give more control to the end user who can decide what to do with an I understand the extra code you wrote sounds like a useful utility function but at the end it can be replaced with a few line as explained here https://pkg.go.dev/io/ioutil#ReadAll and I don't think it should be something to include as part of the testcontainer library. What do you think? |
Hey @gianarb, Cheers, |
Hey @mdelapenya or @gianarb , |
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 LGTM! Thanks again for this contribution and for your patience. I usually wait for @gianarb performing the merges, so let's wait for that review.
BTW, the GH action complains about source formatting in the Could you run |
@mdelapenya fixed it, forgot to run "go fmt" ... |
And just so you know what this is for: Here is the example of what I am using it for: |
@codepitbull omg this is great! 💯 FYI the original k3s minimal container was created by @rnorth, I am just a messenger here :D |
Thank you for this!! |
Thanks to you and the other maintainers! |
Why ?
While working on a k3s-container I needed to extract the kubeconfig from the running container and discovered that there is no CopyFileFromContainer available.
What ?
Added CopyFileFromContainer to DockerContainer.
Added Unit-test for the new Function.