File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 4444
4545import hudson .AbortException ;
4646import io .fabric8 .kubernetes .api .model .Container ;
47+ import jenkins .security .MasterToSlaveCallable ;
4748import org .apache .commons .io .output .TeeOutputStream ;
4849import org .csanchez .jenkins .plugins .kubernetes .ContainerTemplate ;
4950import org .csanchez .jenkins .plugins .kubernetes .KubernetesSlave ;
@@ -459,7 +460,13 @@ public void onClose(int i, String s) {
459460 }
460461 toggleStdout .disable ();
461462 OutputStream stdin = watch .getInput ();
462- PrintStream in = new PrintStream (stdin , true , StandardCharsets .UTF_8 .name ());
463+ // Initialize a PrintStream with line separator from agent
464+ PrintStream in = pwd .getChannel ().call (new MasterToSlaveCallable <PrintStream , UnsupportedEncodingException >() {
465+ @ Override
466+ public PrintStream call () throws UnsupportedEncodingException {
467+ return new PrintStream (stdin , true , StandardCharsets .UTF_8 .name ());
468+ }
469+ });
463470 if (pwd != null ) {
464471 // We need to get into the project workspace.
465472 // The workspace is not known in advance, so we have to execute a cd command.
You can’t perform that action at this time.
0 commit comments