How to get wich job is launching a pod in kubernetes-plugin ?

20 views
Skip to first unread message

Mathieu Delrocq

unread,
Jul 26, 2019, 5:21:27 AM7/26/19
to Jenkins Developers
Hello,

With docker-plugin, there is a log to know wich job is executing wich docker-agent, I want to know if there is something similar in kubernetes-plugin.
Or if there is a way to catch the information.

Thanks

Jesse Glick

unread,
Jul 26, 2019, 11:27:39 AM7/26/19
to Jenkins Dev
I am afraid I did not really follow the question. Are you writing a
plugin which needs to access information about job/agent associations?
What precise piece of information are you looking to obtain, based on
what inputs?

Mathieu Delrocq

unread,
Jul 29, 2019, 4:55:55 AM7/29/19
to Jenkins Developers
Hi Jesse. I want to get wich run/job is running on an agent of kubernetes-plugin.
In docker-plugin, there is a simple log at the end of an agent's task :

    private void done(Executor executor) {
        final DockerComputer c = (DockerComputer) executor.getOwner();
        Queue.Executable exec = executor.getCurrentExecutable();
        if (exec instanceof ContinuableExecutable && ((ContinuableExecutable) exec).willContinue()) {
            LOGGER.log(Level.FINE, "not terminating {0} because {1} says it will be continued", new Object[]{c.getName(), exec});
            return;
        }
        LOGGER.log(Level.FINE, "terminating {0} since {1} seems to be finished", new Object[]{c.getName(), exec});
        done(c);
    }

Is there a way to get the information in kubernetes-plugin? or if a plugin exist to get this informations on all jenkins agent?

Thank you.
Reply all
Reply to author
Forward
0 new messages