Config EnvVars passed without leading _ (#534)

* Earlier X=Y was passed as _X=Y

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni
2017-03-04 05:47:00 +05:30
committed by Travis Reeder
parent f6317582c2
commit fae66764b4
3 changed files with 4 additions and 4 deletions

View File

@@ -61,6 +61,9 @@ func (s *Server) handleSpecial(c *gin.Context) {
func toEnvName(envtype, name string) string {
name = strings.ToUpper(strings.Replace(name, "-", "_", -1))
if envtype == "" {
return name
}
return fmt.Sprintf("%s_%s", envtype, name)
}

View File

@@ -90,9 +90,6 @@ func TestRouteRunnerAsyncExecution(t *testing.T) {
if test.expectedEnv != nil {
for name, value := range test.expectedEnv {
taskName := name
if name == "APP" || name == "TEST" {
taskName = fmt.Sprintf("_%s", name)
}
if value != task.EnvVars[taskName] {
t.Errorf("Test %d: Expected header `%s` to be `%s` but was `%s`",
i, name, value, task.EnvVars[taskName])