Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable setting slaveConnectTimeout in podTemplate defined in pipeline #213

Merged

Conversation

kayano
Copy link

@kayano kayano commented Aug 30, 2017

This PR enable to redefine default slaveConnectTimeout for podTemplate declared in pipeline, eg.

podTemplate(
    label: 'mypod', 
    containers: [
        containerTemplate(name: 'busybox', image: 'busybox', ttyEnabled: true, command: '/bin/cat'),
    ],
    slaveConnectTimeout: 200
) {
    node ('mypod') {
        stage('Run') {
            container('busybox') {
                sh 'echo "pwd is -$(pwd)-"'
            }
        }
    }
}

@carlossg carlossg merged commit e730162 into jenkinsci:master Sep 3, 2017
@carlossg
Copy link
Contributor

carlossg commented Sep 3, 2017

thanks!

@kayano kayano deleted the slave-connect-timeout-in-pipeline-step branch September 4, 2017 13:23
@piyush-garg
Copy link

@kayano @carlossg Thanks for this feature. What I am able to understand is that this is regarding if slave pod not able to connect to master then it will timeout after the mentioned time.

But I have some doubts regarding this if you can clear.

Is my understanding correct ?

The value provided is in seconds I think?

Right now if slave pod does not come up it throws message like, and fails

Still waiting to schedule task
Jenkins doesn’t have label mavenprojectname_2

After this variable does it throw some nice user understandable error or can we somehow achieve that to put nice error message?

Thanks in advance.

cc @hrishin

@piyush-garg
Copy link

@kayano @carlossg I tried this feature works fine. If it fails to connect in that much time period, it terminates that port and new pod come up but this thing happens infinite time. Can you help me with any method that we can make it try for a fixed number of times and then fail with some error and we can show a nice error message to the user.

I am not able to figure out that. If you can help me here, it will be great. Thanks a lot in advance.

cc @hrishin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants