-
Bug
-
Resolution: Unresolved
-
Minor
-
None
Jenkins picks a random agent if agent is 'null'
How to reproduce
- 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
- 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
- Fail the pipeline if the agent is null .