mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 04:56:38 +00:00
Allow dot in function name
This patch enables the use-case for multiple namepsaces by allowing a dot to be used in the function name. dep has been run to update OpenFaaS projects and also to prune unused files. Tested by doing a build. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
dc3c5fb9b3
commit
0a90125aba
40
gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler_test.go
generated
vendored
40
gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler_test.go
generated
vendored
@ -1,40 +0,0 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/openfaas/nats-queue-worker/nats"
|
||||
)
|
||||
|
||||
func Test_GetClientID_ContainsHostname(t *testing.T) {
|
||||
c := DefaultNATSConfig{}
|
||||
|
||||
val := c.GetClientID()
|
||||
|
||||
hostname, _ := os.Hostname()
|
||||
encodedHostname := nats.GetClientID(hostname)
|
||||
if !strings.HasSuffix(val, encodedHostname) {
|
||||
t.Errorf("GetClientID should contain hostname as suffix, got: %s", val)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreategetClientID(t *testing.T) {
|
||||
clientID := getClientID("computer-a")
|
||||
want := "faas-publisher-computer-a"
|
||||
if clientID != want {
|
||||
t.Logf("Want clientID: `%s`, but got: `%s`\n", want, clientID)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreategetClientIDWhenHostHasUnsupportedCharacters(t *testing.T) {
|
||||
clientID := getClientID("computer-a.acme.com")
|
||||
want := "faas-publisher-computer-a_acme_com"
|
||||
if clientID != want {
|
||||
t.Logf("Want clientID: `%s`, but got: `%s`\n", want, clientID)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user