Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit c69616e

Browse files
authored
Merge pull request #36 from evankanderson/buildable
Remove environment overrides that cause problems for the buildpack case.
2 parents 78f410b + 39bfae4 commit c69616e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ var (
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

Comments
 (0)