space before environment name causes variable to be ignored

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: Minor
    • Component/s: core
    • Environment:

      Manage Jenkins/Configure System

      Under Global Properties add an environment variable.

      Make a mistake and have space before the name.  Example:

      Name: " DOCKER_DEFAULT_PLATFORM"
      Value: "linux/amd64"

      Save

      Then run a job that dumps the environment variables:

      // Uses Declarative syntax to run commands inside a container.
      pipeline {
          agent { label "docker-host" }
          stages {
              stage('Main') {
                  steps {
                      sh '''
                      env | sort
                      '''
                  }
              }
          }
      }
      

      The variable will not be present.

       

      Expected: 

      Warning is given in the screen above about leading whitespace

      or

      Leading and trailing whitespace is automatically removed

      or

      Environment variable is set, with the whitespace in the name.

            Assignee:
            Unassigned
            Reporter:
            Marc Pawlowsky
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: