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.