Allow explicit configuration of TTRPC address

Previously the TTRPC address was generated as "<GRPC address>.ttrpc".
This change now allows explicit configuration of the TTRPC address, with
the default still being the old format if no value is specified.

As part of this change, a new configuration section is added for TTRPC
listener options.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
This commit is contained in:
Kevin Parsons
2019-08-19 13:27:06 -07:00
parent bd46ea5191
commit d7e1b25384
11 changed files with 73 additions and 49 deletions

View File

@@ -38,7 +38,7 @@ import (
var runtimePaths sync.Map
// Command returns the shim command with the provided args and configuration
func Command(ctx context.Context, runtime, containerdAddress, path string, opts *types.Any, cmdArgs ...string) (*exec.Cmd, error) {
func Command(ctx context.Context, runtime, containerdAddress, containerdTTRPCAddress, path string, opts *types.Any, cmdArgs ...string) (*exec.Cmd, error) {
ns, err := namespaces.NamespaceRequired(ctx)
if err != nil {
return nil, err
@@ -50,6 +50,7 @@ func Command(ctx context.Context, runtime, containerdAddress, path string, opts
args := []string{
"-namespace", ns,
"-address", containerdAddress,
"-ttrpc-address", containerdTTRPCAddress,
"-publish-binary", self,
}
args = append(args, cmdArgs...)