Add a property to track whether a container needs terminal

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2016-09-12 16:52:29 -07:00
parent 0681d5d94b
commit 6e05f772ed
2 changed files with 5 additions and 3 deletions

View file

@ -121,6 +121,7 @@ type Container struct {
logPath string logPath string
labels map[string]string labels map[string]string
sandbox string sandbox string
terminal bool
state *ContainerState state *ContainerState
stateLock sync.Mutex stateLock sync.Mutex
} }
@ -133,13 +134,14 @@ type ContainerState struct {
} }
// NewContainer creates a container object. // NewContainer creates a container object.
func NewContainer(name string, bundlePath string, logPath string, labels map[string]string, sandbox string) (*Container, error) { func NewContainer(name string, bundlePath string, logPath string, labels map[string]string, sandbox string, terminal bool) (*Container, error) {
c := &Container{ c := &Container{
name: name, name: name,
bundlePath: bundlePath, bundlePath: bundlePath,
logPath: logPath, logPath: logPath,
labels: labels, labels: labels,
sandbox: sandbox, sandbox: sandbox,
terminal: terminal,
} }
return c, nil return c, nil
} }

View file

@ -139,7 +139,7 @@ func (s *Server) CreatePodSandbox(ctx context.Context, req *pb.CreatePodSandboxR
} }
containerName := name + "-infra" containerName := name + "-infra"
container, err := oci.NewContainer(containerName, podSandboxDir, podSandboxDir, labels, name) container, err := oci.NewContainer(containerName, podSandboxDir, podSandboxDir, labels, name, false)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -540,7 +540,7 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
return nil, err return nil, err
} }
container, err := oci.NewContainer(name, containerDir, logPath, labels, podSandboxId) container, err := oci.NewContainer(name, containerDir, logPath, labels, podSandboxId, containerConfig.GetTty())
if err != nil { if err != nil {
return nil, err return nil, err
} }