• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-plugin
    • 1.28.5

      Current documentation examples and tests generally use something like

      containerTemplate(name: 'busybox', image: 'busybox', command: '/bin/cat', ttyEnabled: true)
      

      to indicate that the container should go to sleep while waiting for exec calls in. While this works, it is rather obscure and ugly. Few users are likely to be immediately familiar with the ttyEnabled flag, and even then it is less than obvious why the interaction with cat would result in a container sleeping.

      Better to use e.g.

      containerTemplate(name: 'busybox', image: 'busybox', command: 'sleep', args: '99d')
      

      which is self-explanatory. (GNU sleep accepts infinity as an argument, but POSIX does not specify it. POSIX does not seem to specify the d suffix either, but Busybox accepts it nonetheless. sleep 9999999 might be the most conservative choice.)

      Better still to make this the default (if an image includes cat it probably includes sleep too) so users do not have to think about this technicality:

      containerTemplate(name: 'busybox', image: 'busybox')
      

          [JENKINS-57841] Better default command for container templates

          Jesse Glick created issue -
          Jesse Glick made changes -
          Assignee Original: Carlos Sanchez [ csanchez ]

          Jesse Glick added a comment -

          For Windows pods (JENKINS-53500), the reasonable default seems to be

              command:
              - powershell
              args:
              - Start-Sleep
              - 999999
          

          Jesse Glick added a comment - For Windows pods ( JENKINS-53500 ), the reasonable default seems to be command: - powershell args: - Start-Sleep - 999999
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-53500 [ JENKINS-53500 ]
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-59909 [ JENKINS-59909 ]
          Kenneth Rogers made changes -
          Assignee New: Kenneth Rogers [ kerogers ]
          Kenneth Rogers made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Kenneth Rogers made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Vincent Latombe made changes -
          Released As New: 1.28.5
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

            kerogers Kenneth Rogers
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: