Skip to content

Commit

Permalink
enable inline exec and attach test
Browse files Browse the repository at this point in the history
Detach automatically on stdin EOF for a non-tty attach when stdin Once is not set.
Forward port of #2129

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Signed-off-by: Peter Hunt <pehunt@redhat.com>
  • Loading branch information
haircommander committed Jun 24, 2019
1 parent 14e284b commit 54d1971
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/test/integration/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
KUBE_CONTAINER_RUNTIME="remote" GINKGO_TOLERATE_FLAKES="y" GINKGO_PARALLEL_NODES=6 GINKGO_PARALLEL=y /usr/bin/go run hack/e2e.go
--test
--test_args="-host=https://{{ ansible_default_ipv4.address }}:6443
--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|PersistentVolumes|\[HPA\]|should.support.building.a.client.with.a.CSR|should.support.inline.execution.and.attach|should.propagate.mounts.to.the.host|for.NodePort.service|type.clusterIP|unready.pods|ExternalName.services|Guestbook.application|in-cluster.config|Pods.should.support.pod.readiness.gates|\[sig-storage\].In-tree.Volumes.\[Driver:.local\]|\[sig-storage\].CSI.Volumes.CSI.Topology.test.using.GCE.PD.driver
--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|PersistentVolumes|\[HPA\]|should.support.building.a.client.with.a.CSR|should.propagate.mounts.to.the.host|for.NodePort.service|type.clusterIP|unready.pods|ExternalName.services|Guestbook.application|in-cluster.config|Pods.should.support.pod.readiness.gates|\[sig-storage\].In-tree.Volumes.\[Driver:.local\]|\[sig-storage\].CSI.Volumes.CSI.Topology.test.using.GCE.PD.driver
--report-dir={{ artifacts }}"
&> {{ artifacts }}/e2e.log
# Fix vim syntax hilighting: "
Expand Down
5 changes: 5 additions & 0 deletions oci/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,8 @@ func (c *Container) SetStartFailed(err error) {
func (c *Container) Description() string {
return fmt.Sprintf("%s/%s/%s", c.Labels()[types.KubernetesPodNamespaceLabel], c.Labels()[types.KubernetesPodNameLabel], c.Labels()[types.KubernetesContainerNameLabel])
}

// StdinOnce returns whether stdin once is set for the container.
func (c *Container) StdinOnce() bool {
return c.stdinOnce
}
3 changes: 3 additions & 0 deletions oci/runtime_oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,9 @@ func (r *runtimeOCI) AttachContainer(c *Container, inputStream io.Reader, output
case err := <-receiveStdout:
return err
case err := <-stdinDone:
if !c.StdinOnce() && !tty {
return nil
}
if _, ok := err.(utils.DetachError); ok {
return nil
}
Expand Down

0 comments on commit 54d1971

Please sign in to comment.