Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47827

Support passing a user/uid into containerTemplate

    Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: kubernetes-plugin
    • Labels:
      None
    • Environment:
      kubernetes 1.7.3
      kubernetes-plugin 1.1
      jenkins 2.83
    • Similar Issues:
    • Released As:
      Fixed

      Description

      Currently, the kubernetes plugin can't run jobs in containers that have unpriveleged users baked into their image metadata. 

      Supporting jobs running as unpriveleged users is a more difficult task. Maybe a minimal solution to this is to allow the user to override the user. Kubernetes supports this, so it should be reasonably straight forward to add a "user" field to the containerTemplate() call.

       

      When a job is run as an unpriveleged user, we see the following error:

       

      // running a job as any user other than root
      sh: 1: cannot create /home/jenkins/workspace/CS-Core-Speedy@tmp/durable-b7e7d045/pid: Permission denied
      sh: 1: cannot create /home/jenkins/workspace/CS-Core-Speedy@tmp/durable-b7e7d045/jenkins-log.txt: Permission denied
      sh: 1: cannot create /home/jenkins/workspace/CS-Core-Speedy@tmp/durable-b7e7d045/jenkins-result.txt: Permission denied
      

       

        Attachments

          Issue Links

            Activity

            Hide
            elhay elhay efrat added a comment -
            Show
            elhay elhay efrat added a comment - Guys can you please approve  [JENKINS-47827 ] adding support Support passing a user/uid into containerTemplate    
            Hide
            elhay elhay efrat added a comment -

            Waiting for code review and merge no conflicts and test covered and pass 

            Show
            elhay elhay efrat added a comment - Waiting for code review and merge no conflicts and test covered and pass 
            Hide
            elhay elhay efrat added a comment -

            Guys, should I close it and close the PR? I see that there is a lot of people that resist this change adding this functionality, I have added it locally in our Jenkins because I have no time for endless conversions  

            Show
            elhay elhay efrat added a comment - Guys, should I close it and close the PR? I see that there is a lot of people that resist this change adding this functionality, I have added it locally in our Jenkins because I have no time for endless conversions  
            Hide
            jonesbusy Valentin Delaye added a comment -

            Oh no, what a shame really... Waiting for this feature since long time.

            Show
            jonesbusy Valentin Delaye added a comment - Oh no, what a shame really... Waiting for this feature since long time.
            Hide
            elhay elhay efrat added a comment -

            Valentin Delaye i finished adding it , only test not finished yet , but as i understand i got blocked   

            Show
            elhay elhay efrat added a comment - Valentin Delaye i finished adding it , only test not finished yet , but as i understand i got blocked   

              People

              • Assignee:
                elhay elhay efrat
                Reporter:
                mogthesprog Morgan Jones
              • Votes:
                5 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: