• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • Jenkins 2.32.x

      Inside of a container i want to define withEnv before running a shell script or something else, the environment variables are not passed in.

      This what i have inside of my container step

      container('java') {
         withEnv(['test=test']) {
            sh """
               export
            """
         }
      }
      

      I would expect to see test=test.  but it is not output, only the environment variables defined in the container def are.

          [JENKINS-43200] withEnv does not work with kubernetes-plugin

          This is quite problematic for me as well. I'm basically going to resort to using string interpolation within a `sh` step to export the variables before running my script.

          Chance Zibolski added a comment - This is quite problematic for me as well. I'm basically going to resort to using string interpolation within a `sh` step to export the variables before running my script.

          Jon Whitcraft added a comment -

          Closing since this is a duplicate

          Jon Whitcraft added a comment - Closing since this is a duplicate

            csanchez Carlos Sanchez
            jwhitcraft Jon Whitcraft
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: