-
Bug
-
Resolution: Unresolved
-
Major
-
None
Hi,
If I understood it correctly, with the Kubernetes Plugin the "jnp" container is where the Jenkins agent is running. The plugin offers the possibility to execute commands in different containers that are started as part of the pipeline.
In order to launch commands in those additional containers, the plugin runs "kubectl exec". Before launching the actual command, the plugin executes a block of instructions to set the execution environment correctly. This block contains for example the environment variables available at that stage of the build.
When preparing the block, the plugin using "println()" to write export instructions:
out.println( String.format( windows ? "set %s=%s" : "export %s='%s'", entry.getKey(), windows ? entry.getValue() : entry.getValue().replace("'", "'\\''") ) );
I believe this causes the block to contain the new line character as configured on the Jenkins Master. In a setup with a Windows Master and Linux Agents, this leads (I think) to additional "\r" characters in the environment variables configured in the additional containers.
See also my last comment on the issue.
Regards
- links to
In our case, heterogeneous environment - mix of windows master and windows and linux nodes, this issue prevents us from using Kubernetes agents in Jenkins