Skip to content

Commit 254141c

Browse files
authored
#16: redundant "/" in load balancer registry key
Fixed a bug where a double "/" would be added to the load balancers' path
2 parents 9020f78 + 95b064f commit 254141c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

internal/registration/registry.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ package registration
22

33
import (
44
"fmt"
5-
"github.com/hexablock/vivaldi"
6-
"github.com/serverledge-faas/serverledge/internal/node"
7-
"golang.org/x/exp/maps"
85
"log"
96
"net"
107
"path"
@@ -14,6 +11,10 @@ import (
1411
"sync"
1512
"time"
1613

14+
"github.com/hexablock/vivaldi"
15+
"github.com/serverledge-faas/serverledge/internal/node"
16+
"golang.org/x/exp/maps"
17+
1718
"github.com/serverledge-faas/serverledge/internal/config"
1819
"github.com/serverledge-faas/serverledge/utils"
1920
"go.etcd.io/etcd/client/v3"
@@ -194,7 +195,8 @@ func GetOneNodeInArea(area string, includeSelf bool) (NodeRegistration, error) {
194195
}
195196

196197
func GetLBInArea(area string) (map[string]NodeRegistration, error) {
197-
baseDir := areaEtcdKey(area) + "/" + registryLoadBalancerDirectory
198+
prefix := areaEtcdKey(area)
199+
baseDir := path.Join(prefix, registryLoadBalancerDirectory)
198200

199201
ctx, _ := context.WithTimeout(context.Background(), 3*time.Second)
200202

0 commit comments

Comments
 (0)