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

Default container selector for the template configuration in the UI

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • kubernetes-plugin
    • None

      This is a request to expose the existing defaultContainer option (as pointed below) to the Cloud configuration, in the Kubernetes Template side.

       agent {
          kubernetes {
            defaultContainer 'maven'
            yamlFile 'KubernetesPod.yaml'
          }
        }
      

      This is how the new UI would be expected to be:

          [JENKINS-64778] Default container selector for the template configuration in the UI

          Pinned comments

          Pinned by Jack

          Jack added a comment - - edited

          Here is a workaround for your reference

          https://github.com/zhan9san/init-jnlp

          Jack added a comment - - edited Here is a workaround for your reference https://github.com/zhan9san/init-jnlp

          All comments

          Felipe Santos added a comment -

          This seems to be the only way to choose what container to use: being the jnlp container.

          The drawback is that now I have an overloaded container with the Docker Daemon running in parallel with the JNLP service.

          Felipe Santos added a comment - This seems to be the only way to choose what container to use: being the jnlp container. The drawback is that now I have an overloaded container with the Docker Daemon running in parallel with the JNLP service.

          Hi felipecassiors, we are no longer actively maintaining this plugin. However, if you find it useful and want to add the suggested functionality, feel free to send a Pull Request for it.

           

          Thanks!

          Guillermo Sanchez Urien added a comment - Hi felipecassiors , we are no longer actively maintaining this plugin. However, if you find it useful and want to add the suggested functionality, feel free to send a Pull Request for it.   Thanks!

          Jesse Glick added a comment -

          I do not think this is possible to implement. In order to use a nondefault container, the container step must be called. In Declarative Pipeline, that is normally done by using agent kubernetes. If you just use agent label (or run a non-Pipeline build), the kubernetes plugin is not even consulted.

          Jesse Glick added a comment - I do not think this is possible to implement. In order to use a nondefault container, the container step must be called. In Declarative Pipeline, that is normally done by using agent kubernetes . If you just use agent label (or run a non-Pipeline build), the kubernetes plugin is not even consulted.

          Felipe Santos added a comment -

          Well, currently `jnlp` seems to be hardcoded as the default container. The same way `jnlp` is used if none is specified, this option should provide the user the ability to select the default container rather than using `jnlp`.

          Felipe Santos added a comment - Well, currently `jnlp` seems to be hardcoded as the default container. The same way `jnlp` is used if none is specified, this option should provide the user the ability to select the default container rather than using `jnlp`.

          Jesse Glick added a comment -

          That is not possible. Using the jnlp container is qualitatively different from using other containers via the container step.

          Jesse Glick added a comment - That is not possible. Using the jnlp container is qualitatively different from using other containers via the container step.

          Pinned by Jack

          Jack added a comment - - edited

          Here is a workaround for your reference

          https://github.com/zhan9san/init-jnlp

          Jack added a comment - - edited Here is a workaround for your reference https://github.com/zhan9san/init-jnlp

            Unassigned Unassigned
            felipecassiors Felipe Santos
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: