42
42
43
43
awsEndpoint = "/2018-06-01/runtime"
44
44
environment = map [string ]string {
45
- "PATH" : "/usr/local/bin:/usr/bin/:/bin:/opt/bin" ,
46
- "LD_LIBRARY_PATH" : "/lib64:/usr/lib64:$LAMBDA_RUNTIME_DIR:$LAMBDA_RUNTIME_DIR/lib:$LAMBDA_TASK_ROOT:$LAMBDA_TASK_ROOT/lib:/opt/lib" ,
45
+ "LD_LIBRARY_PATH" : "/lib64:/usr/lib64:$LAMBDA_RUNTIME_DIR:$LAMBDA_RUNTIME_DIR/lib:$LAMBDA_TASK_ROOT:$LAMBDA_TASK_ROOT/lib:/opt/lib:$LD_LIBRARY_PATH" ,
47
46
"AWS_LAMBDA_RUNTIME_API" : "127.0.0.1" ,
48
47
49
48
// Some dummy values
@@ -66,7 +65,8 @@ type Specification struct {
66
65
// Lambda runtime API port for functions
67
66
InternalAPIport string `envconfig:"internal_api_port" default:"80"`
68
67
// Lambda API port to put function requests and get results
69
- ExternalAPIport string `envconfig:"external_api_port" default:"8080"`
68
+ // Note that this uses the same environment variable Knative uses to communicate expected port.
69
+ ExternalAPIport string `envconfig:"port" default:"8080"`
70
70
71
71
Sink string `envconfig:"k_sink"`
72
72
ResponseFormat string `envconfig:"response_format"`
@@ -94,7 +94,7 @@ func setupEnv(internalAPIport string) error {
94
94
environment ["AWS_LAMBDA_RUNTIME_API" ] += ":" + internalAPIport
95
95
96
96
for k , v := range environment {
97
- if err := os .Setenv (k , v ); err != nil {
97
+ if err := os .Setenv (k , os . ExpandEnv ( v ) ); err != nil {
98
98
return err
99
99
}
100
100
}
0 commit comments