I've started migrated some our microservices builds to use toolchains but I find myself in a bit of an odd situation and would like to understand if there's a way around it.
I had a microservice module use my golang module which could be explained like that
- New()
- Initialize the golang module etc
- Build() *dagger.Container
- call golang.Build
- return the container produced
- Test() (string,error)
- call golang.Test()
- return (string, error)
- Serve() *dagger.Service
- call Build()
- Add Env Variables to container
- return container.AsService()
Now that i'm moving to toolchain i can get rid of Build() and Test() and have the setup the customizations according to my needs
Which leaves Serve(), this wont/can't move to a toolchain because specific to the microservice.
I find myself in a situation where I cant get the *dagger.Container from Build() because it's out of my module now (whole point of using toolchain).
Sure, I could get a instance of the golang module and use it but it feels like it would be defeating the purpose of toolchains (and i would repeat myself injecting customizations via my module's code)
What would be an elegant way of resolving this ? Is there a way to get the configured toolchain directly in my module ?