Skip to content

Commit

Permalink
Config EnvVars passed without leading _ (#534)
Browse files Browse the repository at this point in the history
* Earlier X=Y was passed as _X=Y

Signed-off-by: Goutham Veeramachaneni <[email protected]>
  • Loading branch information
gouthamve authored and treeder committed Mar 4, 2017
1 parent f631758 commit fae6676
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions api/server/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
3 changes: 0 additions & 3 deletions api/server/runner_async_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion docs/writing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You will also have access to a set of environment variables.
* ROUTE - the matched route
* METHOD - the HTTP method for the request
* HEADER_X - the HTTP headers that were set for this request. Replace X with the upper cased name of the header and replace dashes in the header with underscores.
* any configuration values you've set for the Application or the Route. Replace X with the upper cased name of the config variable you set.
* X - any configuration values you've set for the Application or the Route. Replace X with the upper cased name of the config variable you set. Ex: `minio_secret=secret` will be exposed via MINIO_SECRET env var

Warning: these may change before release.

Expand Down

0 comments on commit fae6676

Please sign in to comment.