Since the change of default working directory from /home/jenkins to home/jenkins/agent (see
JENKINS-58705), it is possible to change the working directory back to /home/jenkins but this does not survive a restart.
This behavior is quite confusing.
- Create a pod template and set the working Directory to /home/jenkins
- Restart Jenkins
- Check the pod template configuration
- The pod template configuration hasn't changed. The working directory is /home/jenkins
- The pod template configuration has changed. The working directory is /home/jenkins/agent.
A reliable way to use /home/jenkins as a working directory use YAML definition to define container templates