mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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:
committed by
Travis Reeder
parent
f6317582c2
commit
fae66764b4
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user