[JIRA] (JENKINS-61950) Environment variables with '$' have '$$' when used in sh step inside a container step.

2020-04-17 Thread kerog...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Kenneth Rogers created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61950  
 
 
  Environment variables with '$' have '$$' when used in sh step inside a container step.   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 kubernetes-plugin  
 
 
Created: 
 2020-04-17 14:49  
 
 
Environment: 
 CloudBees Core 2.222.1.1, Kubernetes plugin 1.25.2  
 
 
Labels: 
 kubernetes-plugin  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Kenneth Rogers  
 

  
 
 
 
 

 
 Here's a pipeline that reproduces the bug:   

 

podTemplate {
  node(POD_LABEL) {
container("jnlp") {
  stage("Run") {
env.FOO = '$string\$with\$dollars'
echo "from groovy: ${env.FOO}"
sh 'env | grep FOO'
sh 'echo from sh: $FOO'
}
 }
  }
}
 

 Here's the output: from groovy: $string$with$dollars FOO=$$string$$with$$dollars from sh: $$string$$with$$dollars Note that all the dollar signs have been doubled! Note that we've included a call to env, which prints the same incorrect string, so that we can eliminate the possibility of groovy string interpolation issues. We isolated the problem to the container() function. The bug does not occur with this version of the code, where it is removed, despite that the exact same container (jnlp) is actually used:   


[JIRA] (JENKINS-61950) Environment variables with '$' have '$$' when used in sh step inside a container step.

2020-04-17 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61950  
 
 
  Environment variables with '$' have '$$' when used in sh step inside a container step.   
 

  
 
 
 
 

 
Change By: 
 Jesse Glick  
 
 
Labels: 
 kubernetes-plugin  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.205830.1587134969000.13202.1587138120157%40Atlassian.JIRA.