From 2aec1d60b92be071b06aa65979f2cd4fc48b1a52 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Thu, 11 Apr 2024 12:13:41 +0100 Subject: [PATCH] Update for invoke: 201 is not an error When a function was invoked via faas-cli and returned a 201, the CLI classified this as an error. It isn't. Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- proxy/invoke.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/invoke.go b/proxy/invoke.go index 75a4ac3f..243bdddf 100644 --- a/proxy/invoke.go +++ b/proxy/invoke.go @@ -83,7 +83,7 @@ func InvokeFunction(gateway string, name string, bytesIn *[]byte, contentType st switch res.StatusCode { case http.StatusAccepted: fmt.Fprintf(os.Stderr, "Function submitted asynchronously.\n") - case http.StatusOK: + case http.StatusOK, http.StatusCreated: var readErr error resBytes, readErr = io.ReadAll(res.Body) if readErr != nil {