From 1e9d8fffa072f6048c08c9c90346ab41fcfa068a Mon Sep 17 00:00:00 2001 From: Shikachuu Date: Sat, 21 Aug 2021 13:00:40 +0200 Subject: [PATCH] Updated the env-var usage, as requested from the review of alexellis on the previous PR by utsavanand2 https://github.com/openfaas/faasd/pull/154#discussion_r608777877 Signed-off-by: Shikachuu --- hack/faasd-provider.service | 1 + pkg/provider/handlers/deploy.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/faasd-provider.service b/hack/faasd-provider.service index 4c2b053..19ecced 100644 --- a/hack/faasd-provider.service +++ b/hack/faasd-provider.service @@ -5,6 +5,7 @@ Description=faasd-provider MemoryLimit=500M Environment="secret_mount_path={{.SecretMountPath}}" Environment="basic_auth=true" +Environment="hosts_dir=/var/lib/faasd-provider" ExecStart=/usr/local/bin/faasd provider Restart=on-failure RestartSec=10s diff --git a/pkg/provider/handlers/deploy.go b/pkg/provider/handlers/deploy.go index 25b92d2..fec5f24 100644 --- a/pkg/provider/handlers/deploy.go +++ b/pkg/provider/handlers/deploy.go @@ -247,7 +247,7 @@ func prepareEnv(envProcess string, reqEnvVars map[string]string) []string { } func getMounts() []specs.Mount { - wd, _ := os.Getwd() + wd, _ := os.LookupEnv("hosts_dir") mounts := []specs.Mount{} mounts = append(mounts, specs.Mount{ Destination: "/etc/resolv.conf",