default container in Kubernetes plugin

已查看 732 次
跳至第一个未读帖子

Rick

未读,
2018年8月20日 18:59:242018/8/20
收件人 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

未读,
2018年8月21日 06:34:122018/8/21
收件人 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

未读,
2018年8月21日 06:38:452018/8/21
收件人 jenkin...@googlegroups.com
Yes, I get your point. So I suggest offer a UI option, and let end users make choice.

Carlos Sanchez

未读,
2018年8月21日 06:57:052018/8/21
收件人 Jenkins Developers

arch

未读,
2018年8月21日 06:59:462018/8/21
收件人 jenkin...@googlegroups.com

Carlos Sanchez

未读,
2018年8月21日 07:57:002018/8/21
收件人 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

未读,
2021年3月17日 20:15:562021/3/17
收件人 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

未读,
2021年3月20日 08:57:322021/3/20
收件人 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

未读,
2021年3月24日 18:35:132021/3/24
收件人 Jenkins Developers
Ok, sorry to hear that :/

Thank you!
回复全部
回复作者
转发
0 个新帖子