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

Workspace is set incorrectly for the job with whitespaces in its name

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • Jenkins 2.32.1
      Kubernetes plugin: 0.10

      Example:
      Create pipeline job named "i like spaces":

      podTemplate(label: 'app', containers: [containerTemplate(name: 'docker', image: 'docker:1.11', ttyEnabled: true, command: 'cat')]) {
          node('app') {
                  container('docker') {
                          sh 'pwd'
                  }
          }
      }
      

      ER: Output includes "/home/jenkins/workspace/i like spaces"
      AR: Output includes "/home/jenkins"
      Workaround: rename job to exclude spaces (i.e. "i_like_underscores")

          [JENKINS-41287] Workspace is set incorrectly for the job with whitespaces in its name

          Sergey Kulanov added a comment - the issue is here https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecDecorator.java#L125 you need escaping while `cd`

          Carlos Sanchez added a comment - Fixed in https://github.com/jenkinsci/kubernetes-plugin/pull/131

            csanchez Carlos Sanchez
            electroma Roman Safronov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: