Add version to shim protocol

Document environment variables and test shim start response parsing.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-02-27 08:53:52 -08:00
parent a18709442b
commit dba6f9db18
6 changed files with 146 additions and 23 deletions

View File

@@ -24,7 +24,6 @@ import (
"os"
"path/filepath"
gruntime "runtime"
"strings"
"github.com/sirupsen/logrus"
@@ -120,7 +119,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
if err != nil {
return nil, fmt.Errorf("%s: %w", out, err)
}
address := strings.TrimSpace(string(out))
response := bytes.TrimSpace(out)
onCloseWithShimLog := func() {
onClose()
@@ -132,7 +131,12 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
return nil, err
}
conn, err := makeConnection(ctx, address, onCloseWithShimLog)
params, err := parseStartResponse(ctx, response)
if err != nil {
return nil, err
}
conn, err := makeConnection(ctx, params, onCloseWithShimLog)
if err != nil {
return nil, err
}