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

Add ability to tell which container is currently active

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • 1.28.6

      When writing pipeline libraries that utilize pod based agents, it would be useful to know a few bits about the pod and container currently running. Currently all you can get is pod name...kind of...

      The easiest way to accomplish this is to add a few env variables - for example:

      • JENKINS_CONTAINER - name of the currently active container
      • JENKINS_CONTAINERS - list of all containers in the pod

      It seems these should be easily injectable when switching containers

       

       

          [JENKINS-63627] Add ability to tell which container is currently active

          Vincent Latombe added a comment - - edited

          Implemented with POD_CONTAINER variable. Listing containers would need to be implemented a separate ticket.

          Vincent Latombe added a comment - - edited Implemented with POD_CONTAINER variable. Listing containers would need to be implemented a separate ticket.

          Thank you!!! Will open second tcket as recommended

          Michael Lasevich added a comment - Thank you!!! Will open second tcket as recommended

            vlatombe Vincent Latombe
            mlasevich Michael Lasevich
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: