Add TERM=xterm when tty=true.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
@@ -202,6 +202,11 @@ func (c *criContainerdService) generateContainerSpec(id string, sandboxPid uint3
|
||||
g.SetProcessCwd(imageConfig.WorkingDir)
|
||||
}
|
||||
|
||||
g.SetProcessTerminal(config.GetTty())
|
||||
if config.GetTty() {
|
||||
g.AddProcessEnv("TERM", "xterm")
|
||||
}
|
||||
|
||||
// Apply envs from image config first, so that envs from container config
|
||||
// can override them.
|
||||
if err := addImageEnvs(&g, imageConfig.Env); err != nil {
|
||||
@@ -230,8 +235,6 @@ func (c *criContainerdService) generateContainerSpec(id string, sandboxPid uint3
|
||||
g.SetLinuxCgroupsPath(cgroupsPath)
|
||||
}
|
||||
|
||||
g.SetProcessTerminal(config.GetTty())
|
||||
|
||||
if err := setOCICapabilities(&g, securityContext.GetCapabilities(), securityContext.GetPrivileged()); err != nil {
|
||||
return nil, fmt.Errorf("failed to set capabilities %+v: %v",
|
||||
securityContext.GetCapabilities(), err)
|
||||
|
||||
Reference in New Issue
Block a user