Open
Description
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
Labels
No labels