Skip to content

Commit 6685718

Browse files
committed
remove leading / from kv keys
1 parent 83ef89f commit 6685718

File tree

17 files changed

+24
-24
lines changed

17 files changed

+24
-24
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ AgentPort is the default port on which to attempt contacting an agent
3939
```go
4040
var (
4141
// ConfigPath is the path in the config store.
42-
ConfigPath = "/lochness/config/"
42+
ConfigPath = "lochness/config/"
4343
)
4444
```
4545

@@ -57,14 +57,14 @@ use
5757
```go
5858
var (
5959
// FWGroupPath is the path in the config store
60-
FWGroupPath = "/lochness/fwgroups/"
60+
FWGroupPath = "lochness/fwgroups/"
6161
)
6262
```
6363

6464
```go
6565
var (
6666
// FlavorPath is the path in the config store
67-
FlavorPath = "/lochness/flavors/"
67+
FlavorPath = "lochness/flavors/"
6868
)
6969
```
7070

@@ -78,35 +78,35 @@ var (
7878
```go
7979
var (
8080
// HypervisorPath is the path in the config store
81-
HypervisorPath = "/lochness/hypervisors/"
81+
HypervisorPath = "lochness/hypervisors/"
8282
)
8383
```
8484

8585
```go
8686
var (
8787
// NetworkPath is the path in the config store.
88-
NetworkPath = "/lochness/networks/"
88+
NetworkPath = "lochness/networks/"
8989
)
9090
```
9191

9292
```go
9393
var (
9494
// SubnetPath is the key prefix for subnets
95-
SubnetPath = "/lochness/subnets/"
95+
SubnetPath = "lochness/subnets/"
9696
)
9797
```
9898

9999
```go
100100
var (
101101
// VLANGroupPath is the path in the config store for VLAN groups
102-
VLANGroupPath = "/lochness/vlangroups/"
102+
VLANGroupPath = "lochness/vlangroups/"
103103
)
104104
```
105105

106106
```go
107107
var (
108108
// VLANPath is the path in the config store for VLANs
109-
VLANPath = "/lochness/vlans/"
109+
VLANPath = "lochness/vlans/"
110110
)
111111
```
112112

cmd/cdhcpd/cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s *CmdSuite) TestCmd() {
7676
s.Equal(-1, status, "expected status code to be that of a killed process")
7777

7878
// so that common.Suite.TearDownTest does not fail
79-
s.KV.Set("/lochness", "hi")
79+
s.KV.Set("lochness", "hi")
8080
}
8181

8282
func (s *CmdSuite) checkConfFiles(hypervisor *lochness.Hypervisor, guest *lochness.Guest) bool {

cmd/cdhcpd/fetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type (
3232
}
3333
)
3434

35-
var matchKeys = regexp.MustCompile(`^/lochness/(hypervisors|subnets|guests)/([0-9a-f\-]+)(/([^/]+))?(/.*)?`)
35+
var matchKeys = regexp.MustCompile(`^lochness/(hypervisors|subnets|guests)/([0-9a-f\-]+)(/([^/]+))?(/.*)?`)
3636

3737
// NewFetcher creates a new fetcher
3838
func NewFetcher(kvAddress string) *Fetcher {

cmd/cdhcpd/fetcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (s *FetcherSuite) TestIntegrateResponse() {
122122
{"create wrong key",
123123
kv.Event{
124124
Type: kv.Create,
125-
Key: "/foobar/baz",
125+
Key: "foobar/baz",
126126
}, false, true,
127127
},
128128
{"set hypervisor",

cmd/nconfigd/cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (s *CmdSuite) TestCmd() {
106106
}
107107

108108
tests := []testCase{
109-
{"unwatched", "/foobar", "true", 1, []string{}},
109+
{"unwatched", "foobar", "true", 1, []string{}},
110110
}
111111
for key, roles := range s.Config {
112112
tests = append(tests, testCase{filepath.Base(key), key, "true", 2, roles})

cmd/nheartbeatd/cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s *CmdSuite) TestCmd() {
7676
break
7777
}
7878

79-
resp, err := s.KV.Get(fmt.Sprintf("/lochness/hypervisors/%s/heartbeat", test.id))
79+
resp, err := s.KV.Get(fmt.Sprintf("lochness/hypervisors/%s/heartbeat", test.id))
8080
if !s.NoError(err, msg("heartbeat key should exist")) {
8181
continue
8282
}

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
var (
1414
// ConfigPath is the path in the config store.
15-
ConfigPath = "/lochness/config/"
15+
ConfigPath = "lochness/config/"
1616
)
1717

1818
// GetConfig gets a single value from the config store. The key can contain slashes ("/")

flavor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
var (
1313
// FlavorPath is the path in the config store
14-
FlavorPath = "/lochness/flavors/"
14+
FlavorPath = "lochness/flavors/"
1515
)
1616

1717
type (

fwgroup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
var (
1414
// FWGroupPath is the path in the config store
15-
FWGroupPath = "/lochness/fwgroups/"
15+
FWGroupPath = "lochness/fwgroups/"
1616
)
1717

1818
// XXX: should individual rules be their own keys??

hypervisor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
var (
2121
// HypervisorPath is the path in the config store
22-
HypervisorPath = "/lochness/hypervisors/"
22+
HypervisorPath = "lochness/hypervisors/"
2323
// id of currently running hypervisor
2424
hypervisorID = ""
2525
)

0 commit comments

Comments
 (0)