diff --git a/Gopkg.lock b/Gopkg.lock index 931d0eba..fcae2d16 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -168,7 +168,7 @@ version = "0.17.4" [[projects]] - digest = "1:99dadc2c1ee4102a3ffc1e84d9e182dcb20bed29a89c9f937310b7a969de7f7d" + digest = "1:a32a2587b7ec1ab3661ceaf1779e8dc65d98b3b9482b50184186a3829730c6a7" name = "github.com/openfaas/faas-provider" packages = [ ".", @@ -179,8 +179,8 @@ "types", ] pruneopts = "UT" - revision = "78c25aab33bbdaae7b6d031006535d363eaacda5" - version = "0.13.1" + revision = "7677057e416ba796df41f9f366956a491c5684ff" + version = "0.13.2" [[projects]] digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" diff --git a/Gopkg.toml b/Gopkg.toml index 3388069d..dbdd2365 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -8,7 +8,7 @@ [[constraint]] name = "github.com/openfaas/faas-provider" - version = "0.13.1" + version = "0.13.2" [[constraint]] name = "github.com/docker/go-units" diff --git a/main.go b/main.go index a0721ebb..f550361c 100644 --- a/main.go +++ b/main.go @@ -52,8 +52,6 @@ func main() { funcProxyHandler := handlers.NewFunctionLookup(dockerClient, cfg.DNSRoundRobin) - cfg.FaaSConfig.EnableHealth = true // Needed due to breaking change in #534 - bootstrapHandlers := bootTypes.FaaSHandlers{ DeleteHandler: handlers.DeleteHandler(dockerClient), DeployHandler: handlers.DeployHandler(dockerClient, maxRestarts, restartDelay), @@ -72,7 +70,6 @@ func main() { ReadTimeout: cfg.FaaSConfig.GetReadTimeout(), WriteTimeout: cfg.FaaSConfig.WriteTimeout, TCPPort: cfg.FaaSConfig.TCPPort, - EnableHealth: cfg.FaaSConfig.EnableHealth, EnableBasicAuth: cfg.FaaSConfig.EnableBasicAuth, SecretMountPath: cfg.FaaSConfig.SecretMountPath, } diff --git a/vendor/github.com/openfaas/faas-provider/serve.go b/vendor/github.com/openfaas/faas-provider/serve.go index db55b199..973630eb 100644 --- a/vendor/github.com/openfaas/faas-provider/serve.go +++ b/vendor/github.com/openfaas/faas-provider/serve.go @@ -72,7 +72,7 @@ func Serve(handlers *types.FaaSHandlers, config *types.FaaSConfig) { r.HandleFunc("/function/{name:["+NameExpression+"]+}/", handlers.FunctionProxy) r.HandleFunc("/function/{name:["+NameExpression+"]+}/{params:.*}", handlers.FunctionProxy) - if config.EnableHealth { + if handlers.HealthHandler != nil { r.HandleFunc("/healthz", handlers.HealthHandler).Methods("GET") } diff --git a/vendor/github.com/openfaas/faas-provider/types/config.go b/vendor/github.com/openfaas/faas-provider/types/config.go index a4eb07b4..6f4fd154 100644 --- a/vendor/github.com/openfaas/faas-provider/types/config.go +++ b/vendor/github.com/openfaas/faas-provider/types/config.go @@ -27,7 +27,9 @@ type FaaSHandlers struct { LogHandler http.HandlerFunc // UpdateHandler an existing function/service - UpdateHandler http.HandlerFunc + UpdateHandler http.HandlerFunc + // HealthHandler defines the default health endpoint bound to "/healthz + // If the handler is not set, then the "/healthz" path will not be configured HealthHandler http.HandlerFunc InfoHandler http.HandlerFunc ListNamespaceHandler http.HandlerFunc @@ -42,6 +44,9 @@ type FaaSConfig struct { // HTTP timeout for writing a response from functions. WriteTimeout time.Duration // EnableHealth enables/disables the default health endpoint bound to "/healthz". + // + // Deprecated: basic auth is enabled automatcally by setting the HealthHandler in the FaaSHandlers + // struct. This value is not longer read or used. EnableHealth bool // EnableBasicAuth enforces basic auth on the API. If set, reads secrets from file-system // location specificed in `SecretMountPath`. diff --git a/vendor/github.com/openfaas/faas-provider/types/read_config.go b/vendor/github.com/openfaas/faas-provider/types/read_config.go index 9aad9545..d28a9d1c 100644 --- a/vendor/github.com/openfaas/faas-provider/types/read_config.go +++ b/vendor/github.com/openfaas/faas-provider/types/read_config.go @@ -76,9 +76,8 @@ func ParseString(val string, fallback string) string { // Read fetches config from environmental variables. func (ReadConfig) Read(hasEnv HasEnv) (*FaaSConfig, error) { cfg := &FaaSConfig{ - ReadTimeout: ParseIntOrDurationValue(hasEnv.Getenv("read_timeout"), time.Second*10), - WriteTimeout: ParseIntOrDurationValue(hasEnv.Getenv("write_timeout"), time.Second*10), - // default value from Gateway + ReadTimeout: ParseIntOrDurationValue(hasEnv.Getenv("read_timeout"), time.Second*10), + WriteTimeout: ParseIntOrDurationValue(hasEnv.Getenv("write_timeout"), time.Second*10), EnableBasicAuth: ParseBoolValue(hasEnv.Getenv("basic_auth"), false), // default value from Gateway SecretMountPath: ParseString(hasEnv.Getenv("secret_mount_path"), "/run/secrets/"),