Cleanup shim manager configuration

Keep platforms configuration on task manager and add environment config
for shims.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2024-05-17 17:31:57 -07:00
parent 28b77e33ad
commit ca59fb0b41
6 changed files with 59 additions and 37 deletions

View File

@@ -44,9 +44,9 @@ type CommandConfig struct {
Address string
TTRPCAddress string
Path string
SchedCore bool
Args []string
Opts *types.Any
Env []string
}
// Command returns the shim command with the provided args and configuration
@@ -75,8 +75,8 @@ func Command(ctx context.Context, config *CommandConfig) (*exec.Cmd, error) {
fmt.Sprintf("%s=%s", grpcAddressEnv, config.Address),
fmt.Sprintf("%s=%s", namespaceEnv, ns),
)
if config.SchedCore {
cmd.Env = append(cmd.Env, "SCHED_CORE=1")
if len(config.Env) > 0 {
cmd.Env = append(cmd.Env, config.Env...)
}
cmd.SysProcAttr = getSysProcAttr()
if config.Opts != nil {