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

Label parameter used when called from a freestyle job, but not from a workflow

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Labels:
      None
    • Environment:
      Jenkins 1.625.3, NodeLabel Parameter Plugin 1.7.1
    • Similar Issues:

      Description

      I have a parameterized job with a label parameter called "MYNODE" that defaults to CENTOS7. If I parameterized trigger it from a freestyle job and pass in a NodeLabel parameter with a different value for MYNODE, the job gets run on a node matching that passed label value. If instead I trigger the job from a workflow, like this:

      def nodes = [:]
      nodes['foo'] =

      { build job: 'node-report', parameters: [new hudson.model.StringParameterValue('MYNODE', 'CENTOS6')] }

      parallel nodes

      Then the called job gets executed, and I can see that it has a "MYNODE" parameter with a value of "CENTOS6", but it does not get run on a node matching the passed label value (it runs on a node matching the default label parameter value instead).

        Attachments

          Issue Links

            Activity

            Hide
            ddecock_be Dries Decock added a comment -

            I have a similar issue. I also tried the LabelValueParameter, and import import org.jvnet.jenkins.plugins.nodelabelparameter, but no luck so far.

            Show
            ddecock_be Dries Decock added a comment - I have a similar issue. I also tried the LabelValueParameter, and import import org.jvnet.jenkins.plugins.nodelabelparameter, but no luck so far.
            Hide
            mazimkhan Mohammad Khan added a comment - - edited

            I checked the code and found that the second argument of LabelParameterValue is "label" instead of "value" and changed the argument as:

            [$class: 'LabelParameterValue', name: "label", label: ${build_label}]
            

            Hope this helps.

            Show
            mazimkhan Mohammad Khan added a comment - - edited I checked the code and found that the second argument of LabelParameterValue is "label" instead of "value" and changed the argument as: [$class: 'LabelParameterValue' , name: "label" , label: ${build_label}] Hope this helps.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Did JENKINS-32209 solve the issue? I am not sure

            Show
            oleg_nenashev Oleg Nenashev added a comment - Did  JENKINS-32209 solve the issue? I am not sure
            Hide
            euphxenos Andrew Lawrence added a comment -

            Yes, this is resolved, and my issue appears to be a duplicate of 32209.

            Show
            euphxenos Andrew Lawrence added a comment - Yes, this is resolved, and my issue appears to be a duplicate of 32209.

              People

              • Assignee:
                domi Dominik Bartholdi
                Reporter:
                euphxenos Andrew Lawrence
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: