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

Pipeline Snippet Generator for 'build' steps doesn't generate proper code for node and label parameters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • Jenkins v2.85, Node and Label parameter plugin v1.7.2

      Reporting this as suggested by jglick at https://stackoverflow.com/a/29806918/45375:

      In short: job parameters of type "node" and "label" are not correctly instantiated by the Snippet Generator.

      Current behavior:

      When I use the Snippet Generator with "Build a job", the generated code is :
      
      build job: 'test job', parameters: [<object of type org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterValue>]
      
      
      

      Expected behavior (example, assuming a parameter name of "UPSTREAM_NODE", a node name of "my_node"):

      build job: 'test job', parameters: [[$class: 'NodeParameterValue', name: 'UPSTREAM_NODE', labels: ['my_node'], nodeEligibility: [$class: 'AllNodeEligibility']]]
      
      

       

       

            Unassigned Unassigned
            mklement0 Michael Klement
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: