multi line using K8s java client

68 Views Asked by At

I want to use the k8s java client to create the below spec. The |- is causing a problem

spec:
  containers:
  - args:
    - |-
      trap 'touch /usr/share/pod/done' EXIT
      a/run.sh | tee /b/log/job.log

This is the code I currently have

PodTemplateSpecFluent.SpecNested<JobSpecFluent.TemplateNested<JobFluent.SpecNested<JobBuilder>>> topBuilder = new JobBuilder()
  .withApiVersion("batch/v1")
  ... 
  .addNewVolume()
     .withName("identity-certs")
     .withNewEmptyDir()
     .endEmptyDir()
     .endVolume()
  .addNewContainer()
      .withName("deployer")
      .withCommand("/bin/sh", "-c")
      .withArgs("trap 'touch /usr/share/pod/done' EXIT && a/run.sh | tee /b/log/job.log")
      .withEnv(Arrays.asList(

I somehow am not able to recreate the same spec with the |- . Any ideas?

0

There are 0 best solutions below