From 57fb2d30f0b4ab765b1ce6840190d79a5826eff4 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Wed, 1 Mar 2023 11:20:49 -0800 Subject: [PATCH] Add max shim version environment variable Adds environment variable to shim start command Signed-off-by: Derek McGowan --- runtime/v2/shim/shim.go | 1 + runtime/v2/shim/util.go | 1 + 2 files changed, 2 insertions(+) diff --git a/runtime/v2/shim/shim.go b/runtime/v2/shim/shim.go index 6411a0e79..581474d1a 100644 --- a/runtime/v2/shim/shim.go +++ b/runtime/v2/shim/shim.go @@ -149,6 +149,7 @@ const ( ttrpcAddressEnv = "TTRPC_ADDRESS" grpcAddressEnv = "GRPC_ADDRESS" namespaceEnv = "NAMESPACE" + maxVersionEnv = "MAX_SHIM_VERSION" ) func parseFlags() { diff --git a/runtime/v2/shim/util.go b/runtime/v2/shim/util.go index 4fd9d6a86..cb2b97f86 100644 --- a/runtime/v2/shim/util.go +++ b/runtime/v2/shim/util.go @@ -68,6 +68,7 @@ func Command(ctx context.Context, config *CommandConfig) (*exec.Cmd, error) { cmd.Env = append( os.Environ(), "GOMAXPROCS=2", + fmt.Sprintf("%s=2", maxVersionEnv), fmt.Sprintf("%s=%s", ttrpcAddressEnv, config.TTRPCAddress), fmt.Sprintf("%s=%s", grpcAddressEnv, config.Address), fmt.Sprintf("%s=%s", namespaceEnv, ns),