[JIRA] (JENKINS-60977) Setting working directory to '/home/jenkins' does not persist

9 views
Skip to first unread message

aburdajewicz@cloudbees.com (JIRA)

unread,
Feb 5, 2020, 6:38:02 AM2/5/20
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ created an issue
 
Jenkins / Bug JENKINS-60977
Setting working directory to '/home/jenkins' does not persist
Issue Type: Bug Bug
Assignee: Unassigned
Components: kubernetes-plugin
Created: 2020-02-05 11:37
Environment: kubernetes:1.18.0 and later
Priority: Minor Minor
Reporter: Allan BURDAJEWICZ

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.

Reproduce

  • Create a pod template and set the working Directory to /home/jenkins
  • Restart Jenkins
  • Check the pod template configuration

*Expected*

  • The pod template configuration hasn't changed. The working directory is /home/jenkins

*Actual*

  • The pod template configuration has changed. The working directory is /home/jenkins/agent.

Source

The descriptor migrates the value: https://github.com/jenkinsci/kubernetes-plugin/blob/kubernetes-1.21.1/src/main/java/org/csanchez/jenkins/plugins/kubernetes/ContainerTemplate.java#L435-L441

Workaround

A reliable way to use /home/jenkins as a working directory use YAML definition to define container templates

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

aburdajewicz@cloudbees.com (JIRA)

unread,
Feb 5, 2020, 6:40:02 AM2/5/20
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ commented on Bug JENKINS-60977
 
Re: Setting working directory to '/home/jenkins' does not persist

We should at least warn users of such behavior. We may also add a way to control this (for example a system property that allow to disable the migration / enforcement at https://github.com/jenkinsci/kubernetes-plugin/blob/kubernetes-1.21.1/src/main/java/org/csanchez/jenkins/plugins/kubernetes/ContainerTemplate.java#L435-L441)

vincent@latombe.net (JIRA)

unread,
Feb 17, 2020, 10:32:02 AM2/17/20
to jenkinsc...@googlegroups.com

vincent@latombe.net (JIRA)

unread,
Feb 17, 2020, 10:32:04 AM2/17/20
to jenkinsc...@googlegroups.com
Vincent Latombe started work on Bug JENKINS-60977
 
Change By: Vincent Latombe
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Feb 17, 2020, 10:52:02 AM2/17/20
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-60977
 
Re: Setting working directory to '/home/jenkins' does not persist

Maybe add form validation and/or a runtime warning suggesting users switch to the new value?

vincent@latombe.net (JIRA)

unread,
Feb 17, 2020, 11:03:03 AM2/17/20
to jenkinsc...@googlegroups.com

vincent@latombe.net (JIRA)

unread,
Feb 18, 2020, 5:00:02 AM2/18/20
to jenkinsc...@googlegroups.com
Change By: Vincent Latombe
Status: In Review Fixed but Unreleased
Resolution: Fixed

vincent@latombe.net (JIRA)

unread,
Feb 19, 2020, 4:45:03 AM2/19/20
to jenkinsc...@googlegroups.com
Change By: Vincent Latombe
Status: Fixed but Unreleased Closed
Released As: kubernetes 1.24.0
Reply all
Reply to author
Forward
0 new messages