-
-
Notifications
You must be signed in to change notification settings - Fork 515
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
[Enhancement]: Get FilePaths for DockerCompose #2516
Comments
Hi @mhogara could you share the use case for that? The dockerCompose struct has a reference to all the configs, but it's private. On the other hand, since #2509 it's possible to pass a reader for the compose files so you can build them on the fly, or download them from the internet. What paths would you expect from them in those cases? In any case, having more context about your use case would be of interest to understand better what to do here. Thanks! |
My use case is actually not too far off from what #2509 achieved. I was working on a helper function that generated a Docker Compose file on the fly and then brings up the container. That same helper package then has a wrapper function on But in my case, there was no struct involved and I had just passed around the The work with readers at #2509 might be enough to get me by. The only possible problem I can think of is that I had created a flag to the We can come back to this after the next release is out, but other than that thanks for your help and let me know if there is anything I can clarify. |
In order to test it, you can always consume the main branch in your project: go get github.com/testcontainers/testcontainers-go@main |
@mhogara the readers feature was released in Thanks! |
@mdelapenya I unfortunately don't have the time to test it out. I'll leave it up to your discretion; if I do have other comments/time to test it out, I can come back to this. |
I'm closing this issue as per my previous comments, but please reopen it if you consider what you requested is not doable with the recent releases. Thanks! |
Proposal
After calling
NewDockerCompose
, I would like there to be a way to get the filepaths associated with that compose stack. i.e. something like this:compose, err := tc.NewDockerCompose(filename)
// Print filepaths equivalent to "filename"
fmt.Println(compose.FilePaths)
There is a way to do that in a
LocalDockerCompose
, see below:testcontainers-go/modules/compose/compose_local.go
Line 52 in fa5f304
However, since that is being deprecated, I would like to also have a way to do that from calling
NewDockerCompose
. I've searched thecompose/compose.go
andcompose/compose_api.test.go
files and haven't found anything that looks like an exposed file path, so I'm assuming it doesn't exist. I haven't been able to find anything on it in the documentation either, but in the case some function exists to retrieve the existing filepaths, then this is really an enhancement for the doc. 🙂The text was updated successfully, but these errors were encountered: