diff --git a/oci/oci.go b/oci/oci.go index f456a23b..c4bad957 100644 --- a/oci/oci.go +++ b/oci/oci.go @@ -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 } diff --git a/server/runtime.go b/server/runtime.go index 5b62982e..fd827392 100644 --- a/server/runtime.go +++ b/server/runtime.go @@ -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 }