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

Container tasks (ContainerExecDecorator) not starting on Windows pods

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • kubernetes-plugin

      When attempting to run a command using either the `bat` or `powershell` commands inside a `container()` block, the resulting durable-task script wrapper created in the container is not being run.  I can exec into the container and run it manually, and the resulting output is picked up by Jenkins and the pipeline moves on.  Nothing in the Jenkins log indicates any kind issue trying to run the command.  Commands outside the container block run fine.  The following is the node block I have (nothing fancy):

      node(label) {
        try {
          notifySlack()
          def myRepo = checkout scm
          def gitCommit = myRepo.GIT_COMMIT
          def gitBranch = myRepo.GIT_BRANCH
      
          stage("hello windows") {
            bat "dir /a"
            container(name:'windows-1809') {
                println "really want to do a dir here..."
                bat "dir /w"
                bat "set"
            }
          }
        } catch (e) {
          currentBuild.result = 'FAILURE'
          throw e
        }
        finally {
          notifySlack(currentBuild.result)
          stage("cleanup") {
            print "all done!"
          }
        }
      }
      

            Unassigned Unassigned
            sleerssen Scott Leerssen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: