Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60977

Setting working directory to '/home/jenkins' does not persist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: kubernetes-plugin
    • Labels:
      None
    • Environment:
      kubernetes:1.18.0 and later
    • Similar Issues:
    • Released As:
      kubernetes 1.24.0

      Description

      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

        Attachments

          Issue Links

            Activity

            allan_burdajewicz Allan BURDAJEWICZ created issue -
            allan_burdajewicz Allan BURDAJEWICZ made changes -
            Field Original Value New Value
            Link This issue is caused by JENKINS-58705 [ JENKINS-58705 ]
            vlatombe Vincent Latombe made changes -
            Assignee Vincent Latombe [ vlatombe ]
            vlatombe Vincent Latombe made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            vlatombe Vincent Latombe made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            vlatombe Vincent Latombe made changes -
            Remote Link This issue links to "PR #713 (Web Link)" [ 24503 ]
            vlatombe Vincent Latombe made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Fixed but Unreleased [ 10203 ]
            vlatombe Vincent Latombe made changes -
            Released As kubernetes 1.24.0
            Status Fixed but Unreleased [ 10203 ] Closed [ 6 ]
            brianodriscoll brian odriscoll made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            brianodriscoll brian odriscoll made changes -
            Comment [ Hi guys,  We are still experiencing this bug, we are on jenkins 2.222.44 , k8s version v1.15.10 and jenkins kubernetes plugin version 1.26.0.

            All our jobs that were reliant on the workDir  set as /home/jenkins fail as the plugin 1.26 still uses  /home/jenkins/agent.

            We add set it in the Jenkinsfile to manually use the workDir as /home/jenkins but not ideal as have hundreds of jobs.

            I can send on any logs if needed. Just letting you know about this issue just in case you are hearing from others also.

            Thank you folks

            Brian ]

              People

              Assignee:
              vlatombe Vincent Latombe
              Reporter:
              allan_burdajewicz Allan BURDAJEWICZ
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: