8000 Exec command args seem to be truncated in some cases · Issue #113 · joan38/kubernetes-client · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Exec command args seem to be truncated in some cases #113
Open
@sbrunk

Description

@sbrunk

I'm running into a weird issue with the exec function where using certain shell operators seem to cause a truncation of the remaining input. I.e. using &&, || or ; in seems to remove all commands coming after the respective operator.

How to reproduce:

kubectl run debian --image debian -- sleep 9999

Then in Ammonite run:

@ import $ivy.`com.goyeau::kubernetes-client:0.8.0`
@ import cats.effect.IO
import com.goyeau.kubernetes.client._
import org.typelevel.log4cats.Logger
import org.typelevel.log4cats.slf4j.Slf4jLogger
import java.io.File
import scala.concurrent.ExecutionContext
import cats.effect.unsafe.implicits.global

implicit val logger: Logger[IO] = Slf4jLogger.getLogger[IO]

val kubernetesClient =
  KubernetesClient[IO](KubeConfig.fromFile[IO](new File(s"${System.getProperty("user.home")}/.kube/config")))

val r = kubernetesClient.use(_.pods.namespace("default").exec("debian", command=Seq("sh", "-c", "echo foo && echo bar"))).unsafeToFuture

@ println(new String(r.value.head.get._1(1).data))
// foo

It seems like echo bar is never executed.

kubectl exec for comparison returns the expected output:

kubectl exec debian -- sh -c "echo foo && echo bar"
foo
bar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0