default container in Kubernetes plugin

703 views
Skip to first unread message

Rick

unread,
Aug 20, 2018, 6:59:24 PM8/20/18
to Jenkins Developers
When I configure a pod template with java container. Then run a shell script in pipeline, it will cause an error that can't find command java. So I must specify the container as java first.
I suggest that the java container should be the default container instead of jnlp. Any feedback is thankful, welcome to discuss.

Carlos Sanchez

unread,
Aug 21, 2018, 6:34:12 AM8/21/18
to Jenkins Developers
the problem is how to know when you want a container be a default, you would need to pass it as an option in the pod template definition

On Tue, Aug 21, 2018 at 12:59 AM Rick <linux...@gmail.com> wrote:
When I configure a pod template with java container. Then run a shell script in pipeline, it will cause an error that can't find command java. So I must specify the container as java first.
I suggest that the java container should be the default container instead of jnlp. Any feedback is thankful, welcome to discuss.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/15e65662-377e-41d3-8ee9-9177c8a044e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

arch

unread,
Aug 21, 2018, 6:38:45 AM8/21/18
to jenkin...@googlegroups.com
Yes, I get your point. So I suggest offer a UI option, and let end users make choice.

Carlos Sanchez

unread,
Aug 21, 2018, 6:57:05 AM8/21/18
to Jenkins Developers

arch

unread,
Aug 21, 2018, 6:59:46 AM8/21/18
to jenkin...@googlegroups.com

Carlos Sanchez

unread,
Aug 21, 2018, 7:57:00 AM8/21/18
to jenkin...@googlegroups.com
You can submit a PR. Opening a ticket won't help much as I won't have time to implement it

Daniel Ferreira

unread,
Mar 17, 2021, 8:15:56 PM3/17/21
to Jenkins Developers
Hello, the ticket is already created here: https://issues.jenkins.io/browse/JENKINS-64778

I want to implement it, but need some guidance and ideas ... please :)

After some debugging and reading the code, I found that, when calling
the plugin using label like "agent { label 'ubuntu-18-04' } ", I cannot reuse
the existing "defaultContainer" feature that is available when calling
"agent { kubernetes { ... } } " -- because the implementation fully depends on that
"kubernetes agent" being called.

Instead I was thinking that maybe I need to catch the "steps" calls on
each stage and wrap them in a "ContainerStep" call. But, first, I don't
know if that's possible or how to do it. And, second, this seems like a
huge amount of changes for such a, theoretical, simple feature.

Does anyone has a good idea on how to implement this?

Thanks

Carlos Sanchez

unread,
Mar 20, 2021, 8:57:32 AM3/20/21
to Jenkins Developers
Hi, as Jesse mentioned in jira it is not possible because the plugin is not called unless the pipeline explicitly uses a kubernetes agent


Daniel Ferreira

unread,
Mar 24, 2021, 6:35:13 PM3/24/21
to Jenkins Developers
Ok, sorry to hear that :/

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