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

Jenkins picks a random agent if agent is 'null'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pipeline
    • None

      Jenkins picks a random agent if agent is 'null'

      How to reproduce

      1. Create a pipeline job with following script 
        pipeline {
            agent none
            stages {
                stage ('This stage should not run anywhere.') {
                    agent {
                        label env.NODE_THAT_DOES_NOT_EXIST
                    }
                    steps {
                        echo "Agent is : " + env.NODE_THAT_DOES_NOT_EXIST
                        echo 'Test'
                    }
                }
            }
        }
        

      Results

      1. The way I expect this to work is if the node does not exist, the Jenkins pipeline should fail saying the "The node does not exist" instead of picking up a random agent from available agents.

      Acceptance criteria

      1. Fail the pipeline if the agent is null .

            Unassigned Unassigned
            hpatel hemil patel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: