[JIRA] (JENKINS-59160) Cannot Override workingDir for jnlp container
Title: Message Title Pierson Yieh commented on JENKINS-59160 Re: Cannot Override workingDir for jnlp container We also noticed that `workingDir` was only being ignored when being declared from a podTemplate / pipeline from a Jenkinsfile. Setting the working directory from pod templates saved on the Jenkins Master configuration page were being respected. Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201597.1567204609000.9095.1571258520131%40Atlassian.JIRA.
[JIRA] (JENKINS-59160) Cannot Override workingDir for jnlp container
Title: Message Title Mike Nau updated an issue Jenkins / JENKINS-59160 Cannot Override workingDir for jnlp container Change By: Mike Nau With version 1.18.3 of the Jenkins Kubernetes Plugin, I am not able to override the default workingDir for the jnlp container. Here's the pod template I am using: {code:java}agent {kubernetes {// Using a dynamic pod n ame because static labels are known to cause pod creation errors.label "mypod-${UUID.randomUUID().toString()}"defaultContainer "maven"yaml """apiVersion: v1kind: Podspec: containers: - name: jnlpimage: jenkins/jnlp-slave:alpineargs: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)']workingDir: /home/jenkins/agent2 - name: mavenimage: maven:3.5.3-jdk-8command:- cattty: trueworkingDir: /home/jenkins/agent2"""}}{code}Job errors as (I have added -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true) {code:java}sh: 1: cd: can't cd to /home/jenkins/agent/workspace/Pipeline_With_WorkingDirsh: 1: cannot create /home/jenkins/agent/workspace/Pipeline_With_WorkingDir@tmp/durable-cf37f355/jenkins-log.txt: Directory nonexistentsh: 1: cannot create /home/jenkins/agent/workspace/Pipeline_With_WorkingDir@tmp/durable-cf37f355/jenkins-result.txt.tmp: Directory nonexistentmv: cannot stat '/home/jenkins/agent/workspace/Pipeline_With_WorkingDir@tmp/durable-cf37f355/jenkins-result.txt.tmp': No such file or directoryprocess apparently never started in /home/jenkins/agent/workspace/Pipeline_With_WorkingDir@tmp/durable-cf37f355{code}It appears that the workingDir on our declared jnlp container is not being respected. If I set workingDir to /home/jenkins/agent everything works as expected. We have a large number of existing jobs that depend on the workingDir being set to /home/jenkins. The change to default it to /home/jenkins/agent in v1.18.0 ([https://github.com/jenkinsci/kubernetes-plugin/releases/tag/kubernetes-1.18.0]) caused a lot of our jobs to start failing due to them unfortunately having references to /home/jenkins spread throughout their build & test logic. We are attempting to force the default workingDir back to /home/jenkins until we can update all our existing references to it.
[JIRA] (JENKINS-59160) Cannot Override workingDir for jnlp container
Title: Message Title Mike Nau created an issue Jenkins / JENKINS-59160 Cannot Override workingDir for jnlp container Issue Type: Bug Assignee: Unassigned Components: kubernetes-plugin Created: 2019-08-30 22:36 Environment: Jenkins: 2.176.2 Jenkins Kubernetes Plugin: 1.18.3 Kubernetes: v1.13.9 Cluster OS: Amazon Linux, 64-Bit Priority: Minor Reporter: Mike Nau With version 1.18.3 of the Jenkins Kubernetes Plugin, I am not able to override the default workingDir for the jnlp container. Here's the pod template I am using: agent { kubernetes { // Using a dynamic pod n ame because static labels are known to cause pod creation errors. label "mypod-${UUID.randomUUID().toString()}" defaultContainer "maven" yaml """ apiVersion: v1 kind: Pod spec: containers: - name: jnlp image: jenkins/jnlp-slave:alpine args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)'] workingDir: /home/jenkins/agent2 - name: maven image: maven:3.5.3-jdk-8 command: - cat tty: true workingDir: /home/jenkins/agent2 """ } } Job errors as (I have added -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true) sh: 1: cd: can't cd to /home/jenkins/agent/workspace/Pipeline_With_WorkingDir sh: 1: