Pass ttrpc address to shim via env
Because of the way go handles flags, passing a flag that is not defined will cause an error. In our case, if we kept this as a flag, then third-party shims would break when they see this new flag. To fix this, I moved this new configuration option to an env var. We should use env vars from here on out to avoid breaking shim compat. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -50,7 +50,6 @@ func Command(ctx context.Context, runtime, containerdAddress, containerdTTRPCAdd
|
||||
args := []string{
|
||||
"-namespace", ns,
|
||||
"-address", containerdAddress,
|
||||
"-ttrpc-address", containerdTTRPCAddress,
|
||||
"-publish-binary", self,
|
||||
}
|
||||
args = append(args, cmdArgs...)
|
||||
@@ -96,7 +95,11 @@ func Command(ctx context.Context, runtime, containerdAddress, containerdTTRPCAdd
|
||||
|
||||
cmd := exec.Command(cmdPath, args...)
|
||||
cmd.Dir = path
|
||||
cmd.Env = append(os.Environ(), "GOMAXPROCS=2")
|
||||
cmd.Env = append(
|
||||
os.Environ(),
|
||||
"GOMAXPROCS=2",
|
||||
fmt.Sprintf("%s=%s", ttrpcAddressEnv, containerdTTRPCAddress),
|
||||
)
|
||||
cmd.SysProcAttr = getSysProcAttr()
|
||||
if opts != nil {
|
||||
d, err := proto.Marshal(opts)
|
||||
|
||||
Reference in New Issue
Block a user