Reduce duplication of pre-pull logic

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2020-12-31 18:54:23 +00:00
committed by Alex Ellis
parent c4936133f6
commit 9c04b8dfd7
2 changed files with 8 additions and 19 deletions

View File

@ -57,7 +57,7 @@ func MakeUpdateHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
ctx := namespaces.WithNamespace(context.Background(), faasd.FunctionNamespace)
if err := prepull(ctx, req, client, alwaysPull); err != nil {
if _, err := prepull(ctx, req, client, alwaysPull); err != nil {
log.Printf("[Update] error with pre-pull: %s, %s\n", name, err)
http.Error(w, err.Error(), http.StatusInternalServerError)
}