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) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd) 2021-01-20 11:59:46 +00:00
parent 87d563664a
commit 2e2250afe8

View File

@ -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{}