[JIRA] (JENKINS-58497) Jenkins picks a random agent if agent is 'null'

6 views
Skip to first unread message

hemilpatel17@gmail.com (JIRA)

unread,
Jul 15, 2019, 11:33:02 AM7/15/19
to jenkinsc...@googlegroups.com
hemil patel created an issue
 
Jenkins / Bug JENKINS-58497
Jenkins picks a random agent if agent is 'null'
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: image-2019-07-15-11-32-00-541.png
Components: core
Created: 2019-07-15 15:32
Priority: Minor Minor
Reporter: hemil patel

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 .
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

o.v.nenashev@gmail.com (JIRA)

unread,
Jul 17, 2019, 3:33:02 AM7/17/19
to jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
Change By: Oleg Nenashev
Component/s: pipeline
Component/s: core

o.v.nenashev@gmail.com (JIRA)

unread,
Jul 17, 2019, 3:34:02 AM7/17/19
to jenkinsc...@googlegroups.com
Oleg Nenashev commented on Bug JENKINS-58497
 
Re: Jenkins picks a random agent if agent is 'null'

Looks like "As designed", will defer to the Pipeline team. CC Liam Newman

hemilpatel17@gmail.com (JIRA)

unread,
Jul 17, 2019, 3:53:02 PM7/17/19
to jenkinsc...@googlegroups.com

Hmm, If this is as designed, I can see this being potentially destructive.

For eg.

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 'Do a destructive action'
                killServer()
            }
        }
    }
}

def killServer() {
 //kill server code here
}

For such a small mistake, user should not have to suffer potentially catastrophic damage.

Reply all
Reply to author
Forward
0 new messages