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

"commands" and "args" are being defaulted using Kubernetes plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • None

      We are using terraform and Jenkins configuration as yaml file to deploy Jenkins. When defining Kubernetes Pod templates, whether we set command and args to empty string or not providing it at all, after the deploying Jenkins or refreshing with new configuration, both values are being defaulted to:

       

      command: /bin/sh -c 
      args: cat
      

      This causes issues because each docker image has its own entrypoint or cmd and this overrides them. So now everytime we redeploy Jenkins we have to manually remove command and args within the Jenkins user interface.

      For example, the jnlp container requires to run a specific command defined in jenkins/jnlp-slave:3.23-1-alpine Dockerfile but those default value makes the container not to be able to communicate with Jenkins

       

      I believe this is the issue with the UI template: https://github.com/jenkinsci/kubernetes-plugin/blob/b1ba0de0fc1fcc46937ab5f984289ff7b5594cef/src/main/resources/org/csanchez/jenkins/plugins/kubernetes/ContainerTemplate/config.jelly#L26

       

      I have created a question in stackoverflow but nobody replied: https://stackoverflow.com/questions/53625733/jenkins-kubernetes-plugin-defaults-command-and-args-to-bash-even-if-we-set-them

       

            Unassigned Unassigned
            xbmono Mohammad Norouzi
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: