4242
4343 awsEndpoint = "/2018-06-01/runtime"
4444 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" ,
4746 "AWS_LAMBDA_RUNTIME_API" : "127.0.0.1" ,
4847
4948 // Some dummy values
@@ -66,7 +65,8 @@ type Specification struct {
6665 // Lambda runtime API port for functions
6766 InternalAPIport string `envconfig:"internal_api_port" default:"80"`
6867 // 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"`
7070
7171 Sink string `envconfig:"k_sink"`
7272 ResponseFormat string `envconfig:"response_format"`
@@ -94,7 +94,7 @@ func setupEnv(internalAPIport string) error {
9494 environment ["AWS_LAMBDA_RUNTIME_API" ] += ":" + internalAPIport
9595
9696 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 {
9898 return err
9999 }
100100 }
0 commit comments