From 2e2250afe843e94fcc34e85c5c5173c8602ca56c Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Wed, 20 Jan 2021 11:59:46 +0000 Subject: [PATCH] Use a placeholder commit message for development The faas-cli throws an error because it always expects a commit_message for the gateway version, and if it's null - it will crash. This only affects local development. The code in faas-cli should be changed to use a struct instead of casting to an interface. Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- gateway/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gateway/main.go b/gateway/main.go index c290cc41..95e32004 100644 --- a/gateway/main.go +++ b/gateway/main.go @@ -17,6 +17,7 @@ import ( "github.com/openfaas/faas/gateway/plugin" "github.com/openfaas/faas/gateway/scaling" "github.com/openfaas/faas/gateway/types" + "github.com/openfaas/faas/gateway/version" natsHandler "github.com/openfaas/nats-queue-worker/handler" ) @@ -24,6 +25,11 @@ import ( const NameExpression = "-a-zA-Z_0-9." func main() { + if len(version.GitCommitMessage) == 0 { + version.GitCommitMessage = "Place-holder for commit message" + } + + // log.Printf("Commit: %s", version.GitCommitMessage) osEnv := types.OsEnv{} readConfig := types.ReadConfig{}