-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
Jenkins 2.452.3
Credentials Binding 681.vf91669a_32e45
When using the withCredentials block and setting the usernameVariable field to USER, the exposed environment variable is converted to user instead of USER. This only seems to occur when setting the environment variable key to USER, using fields such as USERNAME don't suffer from this problem. This behavior has changed when we upgraded the plugin from 642.v737c34dea_6c2. Note this is only affecting Linux Kubernetes containers a windows agent and Linux agent did not have this issue.
Example pipeline
withCredentials([usernamePassword(credentialsId:"my-username-password", usernameVariable:"USER", passwordVariable:"PASSWORD")]) { sh "echo \$USER:\$PASSWORD" }
on 681.vf91669a_32e45 it prints the following indicating the value is unset.
:***********
on 642.v737c34dea_6c2
it prints
secret-username:*************
printing out the environment shows the variable is set but the USER variable is set to user instead of USER as specified in the usernameVariable field
user=bld_ffdo