Closed ffromani closed 4 years ago
I found an example of this in the libpod source: https://github.com/containers/libpod/blob/b713e5371fa8767067bd2c329a3744ea593b2ade/pkg/adapter/runtime_remote.go#L550.
It seems after successfully calling the function returned from the initial call, you can just write straight to the connection. The protocol doesn't seem to be specified, but apparently you should expect a ':'
as a response from a successful write :man_shrugging:.
Note that this kind of thing is not possible with current master, see https://github.com/varlink/go/issues/18.
Hey, thanks for chiming in @johanbrandhorst . This was pretty much what I discovered independentyl experimenging with the code. I was thinkering with code in order to find a clean solution to send a PR, but I like your approach in https://github.com/varlink/go/issues/18, let's go this direction!
It seems after successfully calling the function returned from the initial call, you can just write straight to the connection. The protocol doesn't seem to be specified, but apparently you should expect a
':'
as a response from a successful write.
The :
is part of podman's own protocol. With an upgraded connection you define the protocol. Varlink is not part of it anymore.
Can close this with #19 merged
Can close this with #19 merged
agreed
you also want to look into https://github.com/haraldh/govarlinksendfileexample
for an upgrade example
I want to consume the podman interface through varlink. Specifically, I'm looking to use ExecContainer(). This method requires an "upgraded" connection
So I add the
Upgrade
flag to the Send()[1], but how will I get the content?The call immediately returns an empty reply, and later, if I keep reading using the
receive
function I got from Send(), I'll get the output of the command I Exec-uted.But I can't find in the doc how I'm supposed to know when and how much should I read, neither the format of the next replies (they don't seem JSON)
+++
[1] I'm experimenting with a patched version of go-varlink-cmd