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
labels map[string]string
sandbox string
terminal bool
state *ContainerState
stateLock sync.Mutex
}
@ -133,13 +134,14 @@ type ContainerState struct {
}
// 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{
name: name,
bundlePath: bundlePath,
logPath: logPath,
labels: labels,
sandbox: sandbox,
terminal: terminal,
}
return c, nil
}

View file

@ -139,7 +139,7 @@ func (s *Server) CreatePodSandbox(ctx context.Context, req *pb.CreatePodSandboxR
}
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 {
return nil, err
}
@ -540,7 +540,7 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
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 {
return nil, err
}