[JIRA] (JENKINS-42763) Env var HOME for containers has regressed

11 views
Skip to first unread message

parag.doke+techie@gmail.com (JIRA)

unread,
Mar 14, 2017, 1:35:01 PM3/14/17
to jenkinsc...@googlegroups.com
Parag Doke created an issue
 
Jenkins / Bug JENKINS-42763
Env var HOME for containers has regressed
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2017/Mar/14 5:34 PM
Environment: Jenkins ver. 2.7.21.0.1 (CloudBees Jenkins Enterprise 2.7.21.0.1-fixed)
Kubernetes plugin version 0.9
Priority: Major Major
Reporter: Parag Doke

Since version 0.7 of kubernetes-plugin, due to PR https://github.com/jenkinsci/kubernetes-plugin/pull/57, a change was made that I think is specific to some kubernetes cloud environments (openshift), but not all.

For instance, I have a Jenkins instances connected to a kubernetes cluster, and don't want HOME to be set to working directory.

 

I also saw https://github.com/jenkinsci/kubernetes-plugin/pull/128 that attempted to address some points, but (correct me if I am wrong), we'd still need to set HOME on each pod template.

 

I think a better way of fixing the problem would be to introduce a checkbox on the cloud config level ... that says something to the effect of "Ensure functional HOME folder" (to begin with). Such a param would remove the need for each pod template to be configured ... and yet allow Jenkins admin(s) to get the desired effect in case of openshift.

 

Needless to say, this would be conditional:

env.put("HOME", containerTemplate.getWorkingDir());
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

parag.doke+techie@gmail.com (JIRA)

unread,
Mar 14, 2017, 1:38:01 PM3/14/17
to jenkinsc...@googlegroups.com

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Mar 14, 2017, 2:51:09 PM3/14/17
to jenkinsc...@googlegroups.com

you should be able to set home once in a parent template and inherit from there

 

https://github.com/jenkinsci/kubernetes-plugin#pod-template-inheritance

parag.doke+techie@gmail.com (JIRA)

unread,
Mar 21, 2017, 1:12:01 AM3/21/17
to jenkinsc...@googlegroups.com

I think inheriting from a template is a workaround.
Why make it mandatory for everyone to:
1) Have an invalid HOME
2) Else inherit from a template
If their kube cluster is not on OpenShift.

I think we need to fix this the right way ... which should be to add an optional param (ensure HOME is valid ... or something to that effect).

I wish I were better at development ... would make an attempt and raise a PR myself.

jenkins-ci@carlossanchez.eu (JIRA)

unread,
May 25, 2018, 5:14:01 AM5/25/18
to jenkinsc...@googlegroups.com

can you try the latest version?

memotype@gmail.com (JIRA)

unread,
May 8, 2019, 2:55:01 PM5/8/19
to jenkinsc...@googlegroups.com

I'm still having this issue on version 1.15.1. We run a custom image based off of the jnlp-slave image and install several tools that look for config files in $HOME by default, so we changed the working directory to /home/jenkins/work, but $HOME gets set to that too, which means our tools can't find their config files.

 

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

vincent@latombe.net (JIRA)

unread,
Jul 10, 2019, 5:00:04 AM7/10/19
to jenkinsc...@googlegroups.com
Vincent Latombe assigned an issue to Vincent Latombe
 
Change By: Vincent Latombe
Assignee: Carlos Sanchez Vincent Latombe

vincent@latombe.net (JIRA)

unread,
Jul 10, 2019, 5:00:05 AM7/10/19
to jenkinsc...@googlegroups.com
Vincent Latombe started work on Bug JENKINS-42763
 
Change By: Vincent Latombe
Status: Open In Progress

vincent@latombe.net (JIRA)

unread,
Jul 10, 2019, 5:00:05 AM7/10/19
to jenkinsc...@googlegroups.com

vincent@latombe.net (JIRA)

unread,
Jul 10, 2019, 5:02:03 AM7/10/19
to jenkinsc...@googlegroups.com
 

The plugin has been changed to apply the override behaviour only when running on OpenShift.

Also, a warning is now displayed if you end up running the Jenkins agent in a container with HOME=/, which usually indicates the corresponding uid doesn't have any entry under /etc/passwd and no valid HOME directory.

Change By: Vincent Latombe
Status: In Review Fixed but Unreleased
Resolution: Fixed

vincent@latombe.net (JIRA)

unread,
Jul 10, 2019, 8:07:05 AM7/10/19
to jenkinsc...@googlegroups.com
Change By: Vincent Latombe
Status: Fixed but Unreleased Resolved
Released As: 1.17.0
Reply all
Reply to author
Forward
0 new messages