mirror of
https://github.com/openfaas/faas.git
synced 2025-06-23 07:13:23 +00:00
Allow override of HTTP port via env-var
HTTP port can now be overriden through use of "port" environmental variable. Prefer messaging "want" over "wanted" in error messages, this is more idiomatic Golang. Move away from Go ARMv6 (RPi Zero) and give ARMv7 as a minimum version for release binaries. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
@ -144,6 +144,31 @@ func TestRead_EmptyTimeoutConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRead_DefaultPortConfig(t *testing.T) {
|
||||
defaults := NewEnvBucket()
|
||||
|
||||
readConfig := ReadConfig{}
|
||||
config := readConfig.Read(defaults)
|
||||
want := 8080
|
||||
if config.port != want {
|
||||
t.Logf("port got: %d, want: %d\n", config.port, want)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestRead_PortConfig(t *testing.T) {
|
||||
defaults := NewEnvBucket()
|
||||
defaults.Setenv("port", "8081")
|
||||
|
||||
readConfig := ReadConfig{}
|
||||
config := readConfig.Read(defaults)
|
||||
want := 8081
|
||||
if config.port != want {
|
||||
t.Logf("port got: %d, want: %d\n", config.port, want)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestRead_ReadAndWriteTimeoutConfig(t *testing.T) {
|
||||
defaults := NewEnvBucket()
|
||||
defaults.Setenv("read_timeout", "10")
|
||||
|
Reference in New Issue
Block a user