From bbd3b4ff07826a12f0972539e445e60ef772f47e Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Mon, 1 Nov 2021 11:04:38 +0000 Subject: [PATCH] Add comment to explain how method works Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- pkg/provider/handlers/scale.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/provider/handlers/scale.go b/pkg/provider/handlers/scale.go index 3f5e90f..c2d3919 100644 --- a/pkg/provider/handlers/scale.go +++ b/pkg/provider/handlers/scale.go @@ -156,6 +156,13 @@ func MakeReplicaUpdateHandler(client *containerd.Client, cni gocni.CNI, resolver } } +// waitUntilHealthy blocks until the healthPath returns a HTTP 200 for the +// IP address resolved for the given function. +// Maximum retries: 100 +// Delay between each attempt: 20ms +// A custom path can be set via an annotation in the function's spec: +// com.openfaas.health.http.path: /handlers/ready +// func waitUntilHealthy(name string, resolver proxy.BaseURLResolver, healthPath string) error { endpoint, err := resolver.Resolve(name) if err != nil {