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

nodelabelparameter does not work on declarative pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • Running in a container in Kubernetes
      Jenkins: 2.401.3
      OS: Linux - 4.18.0-372.69.1.el8_6.x86_64
      Java: 11.0.19 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
      nodelabelparameter: 1.12.0

      I think the nodelabelparameter plugin is bugged because I cannot execute a declarative pipeline on all nodes with a specific label. To repro:

       

      • Create a New Item
      • Pipeline
      • "Do not allow concurrent builds" is unchecked by default
      • Check "This project is parameterized"
      • Add Parameter --> Label
        • Name = node_label
        • Default Value = Linux
        • Check "Run on all nodes matching the label"
        • Check "Run regardless of result"
        • Node eligibility = All Nodes (but also tested with Ignore Offline Nodes with same result)
        • Create just the boilerplate pipeline script with "try sample Pipeline --> "Hello World" which is this:

       

      pipeline {
          agent any
          stages {
              stage('Hello') {
                  steps {
                      echo 'Hello World'
                  }
              }
          }
      }
      

       

      When I try to run the pipeline, it asks for my node label and even shows all the nodes associated with that label under "Show nodes" but the pipeline ignores this parameter completely. Changing the agent declaration in the pipeline doesn't change anything. For the agent declaration, I've tried

      • agent none
      • agent any
      • agent { label 'params.node_label' }
      • agent { label 'env.node_label' }
      • agent { label 'node_label' }

            Unassigned Unassigned
            ste13141 Steven
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: