ServeConfig supports a manual listener - #140
Conversation
This lets the plugin more carefully control the address it wants to listen on. This is an advanced use case and not typically necessary. However, it has its uses if you want to force a plugin to serve on a specific network.
apparentlymart
left a comment
There was a problem hiding this comment.
I like the general idea of this. I have a question inline about one specific detail, but it's not a super-important one.
paddycarver
left a comment
There was a problem hiding this comment.
This makes sense to me, and seems like it would address my use case. I agree with Martin's comment about ownership of the listener.
But I think I could build a ReattachConfig from a server process by recording the PID of the process, passing in a listener and using it as the source of the net.Addr, and just reimplementing protocolVersion or hardcoding grpc. Which then gets me what I need to have Terraform attach to a delve-wrapped plugin.
So as long as Martin is cool with this approach (as I'll be trying to merge it into Terraform), it works for me.
|
Done! |
This lets the plugin more carefully control the address it wants to
listen on. This is an advanced use case and not typically necessary.
However, it has its uses if you want to force a plugin to serve on a
specific network.