Skip to content

Commit 7a2404e

Browse files
committed
Update cn-infra with rename of etcdv3 to etcd
Signed-off-by: Ondrej Fabry <[email protected]>
1 parent ad07708 commit 7a2404e

File tree

45 files changed

+424
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+424
-104
lines changed

Gopkg.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ required = [
3636

3737
[[constraint]]
3838
name = "github.com/ligato/cn-infra"
39-
revision = "f7af8757d5426e3ea1f0c865207793e305a315c9"
39+
revision = "df5295a976cf70b7086ec7f0666a9bd235450959"
4040

4141
[[constraint]]
4242
branch = "master"

cmd/agentctl/cmd/root_cmd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ var RootCmd = &cobra.Command{
3232
Short: "A CLI tool for the vnf-agent",
3333
Long: `
3434
A CLI tool to show the state of and to configure agents connected to
35-
Etcd. Use the 'ETCDV3_ENDPOINTS'' environment variable or the 'endpoints'
35+
Etcd. Use the 'ETCD_ENDPOINTS'' environment variable or the 'endpoints'
3636
flag in the command line to specify one or more Etcd instances to
3737
connect to.`,
3838
Example: `Specify the etcd to connect to and list all agents that it knows about:
39-
$ export ETCDV3_ENDPOINTS=172.17.0.1:2379
39+
$ export ETCD_ENDPOINTS=172.17.0.1:2379
4040
$ ./agentctl list
4141
4242
Do as above, but with a command line flag:

cmd/agentctl/utils/common_utils.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"fmt"
2222

2323
"github.com/ligato/cn-infra/db/keyval"
24-
"github.com/ligato/cn-infra/db/keyval/etcdv3"
24+
"github.com/ligato/cn-infra/db/keyval/etcd"
2525
"github.com/ligato/cn-infra/db/keyval/kvproto"
2626
"github.com/ligato/cn-infra/logging"
2727
"github.com/ligato/cn-infra/logging/logrus"
@@ -163,48 +163,48 @@ func rebuildName(params []string) string {
163163
}
164164

165165
// GetDbForAllAgents opens a connection to etcd, specified in the command line
166-
// or the "ETCDV3_ENDPOINTS" environment variable.
166+
// or the "ETCD_ENDPOINTS" environment variable.
167167
func GetDbForAllAgents(endpoints []string) (keyval.ProtoBroker, error) {
168168
if len(endpoints) > 0 {
169169
ep := strings.Join(endpoints, ",")
170-
os.Setenv("ETCDV3_ENDPOINTS", ep)
170+
os.Setenv("ETCD_ENDPOINTS", ep)
171171
}
172172

173-
cfg := &etcdv3.Config{}
174-
etcdConfig, err := etcdv3.ConfigToClient(cfg)
173+
cfg := &etcd.Config{}
174+
etcdConfig, err := etcd.ConfigToClient(cfg)
175175

176176
// Log warnings and errors only.
177177
log := logrus.DefaultLogger()
178178
log.SetLevel(logging.WarnLevel)
179-
etcdv3Broker, err := etcdv3.NewEtcdConnectionWithBytes(*etcdConfig, log)
179+
etcdBroker, err := etcd.NewEtcdConnectionWithBytes(*etcdConfig, log)
180180
if err != nil {
181181
return nil, err
182182
}
183183

184-
return kvproto.NewProtoWrapperWithSerializer(etcdv3Broker, &keyval.SerializerJSON{}), nil
184+
return kvproto.NewProtoWrapperWithSerializer(etcdBroker, &keyval.SerializerJSON{}), nil
185185

186186
}
187187

188188
// GetDbForOneAgent opens a connection to etcd, specified in the command line
189-
// or the "ETCDV3_ENDPOINTS" environment variable.
189+
// or the "ETCD_ENDPOINTS" environment variable.
190190
func GetDbForOneAgent(endpoints []string, agentLabel string) (keyval.ProtoBroker, error) {
191191
if len(endpoints) > 0 {
192192
ep := strings.Join(endpoints, ",")
193-
os.Setenv("ETCDV3_ENDPOINTS", ep)
193+
os.Setenv("ETCD_ENDPOINTS", ep)
194194
}
195195

196-
cfg := &etcdv3.Config{}
197-
etcdConfig, err := etcdv3.ConfigToClient(cfg)
196+
cfg := &etcd.Config{}
197+
etcdConfig, err := etcd.ConfigToClient(cfg)
198198

199199
// Log warnings and errors only.
200200
log := logrus.DefaultLogger()
201201
log.SetLevel(logging.WarnLevel)
202-
etcdv3Broker, err := etcdv3.NewEtcdConnectionWithBytes(*etcdConfig, log)
202+
etcdBroker, err := etcd.NewEtcdConnectionWithBytes(*etcdConfig, log)
203203
if err != nil {
204204
return nil, err
205205
}
206206

207-
return kvproto.NewProtoWrapperWithSerializer(etcdv3Broker, &keyval.SerializerJSON{}).
207+
return kvproto.NewProtoWrapperWithSerializer(etcdBroker, &keyval.SerializerJSON{}).
208208
NewBroker(servicelabel.GetAllAgentsPrefix() + agentLabel + "/"), nil
209209

210210
}

cmd/vpp-agent-ctl/data_cmd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"os"
2424

2525
"github.com/ligato/cn-infra/db/keyval"
26-
"github.com/ligato/cn-infra/db/keyval/etcdv3"
26+
"github.com/ligato/cn-infra/db/keyval/etcd"
2727
"github.com/ligato/cn-infra/logging"
2828
"github.com/ligato/cn-infra/logging/logrus"
2929
"github.com/ligato/cn-infra/servicelabel"
@@ -45,7 +45,7 @@ type VppAgentCtl struct {
4545
Log logging.Logger
4646
Commands []string
4747
serviceLabel servicelabel.Plugin
48-
bytesConnection *etcdv3.BytesConnectionEtcd
48+
bytesConnection *etcd.BytesConnectionEtcd
4949
broker keyval.ProtoBroker
5050
}
5151

cmd/vpp-agent-ctl/etcd.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@ import (
2929
"github.com/ligato/cn-infra/config"
3030
"github.com/ligato/cn-infra/datasync"
3131
"github.com/ligato/cn-infra/db/keyval"
32-
"github.com/ligato/cn-infra/db/keyval/etcdv3"
32+
"github.com/ligato/cn-infra/db/keyval/etcd"
3333
"github.com/ligato/cn-infra/db/keyval/kvproto"
3434
)
3535

3636
// CreateEtcdClient uses environment variable or ETCD config file to establish connection
37-
func (ctl *VppAgentCtl) createEtcdClient(configFile string) (*etcdv3.BytesConnectionEtcd, keyval.ProtoBroker, error) {
37+
func (ctl *VppAgentCtl) createEtcdClient(configFile string) (*etcd.BytesConnectionEtcd, keyval.ProtoBroker, error) {
3838
var err error
3939

4040
if configFile == "" {
41-
configFile = os.Getenv("ETCDV3_CONFIG")
41+
configFile = os.Getenv("ETCD_CONFIG")
4242
}
4343

44-
cfg := &etcdv3.Config{}
44+
cfg := &etcd.Config{}
4545
if configFile != "" {
4646
err := config.ParseConfigFromYamlFile(configFile, cfg)
4747
if err != nil {
4848
return nil, nil, err
4949
}
5050
}
51-
etcdConfig, err := etcdv3.ConfigToClient(cfg)
51+
etcdConfig, err := etcd.ConfigToClient(cfg)
5252
if err != nil {
5353
ctl.Log.Fatal(err)
5454
}
5555

56-
bDB, err := etcdv3.NewEtcdConnectionWithBytes(*etcdConfig, ctl.Log)
56+
bDB, err := etcd.NewEtcdConnectionWithBytes(*etcdConfig, ctl.Log)
5757
if err != nil {
5858
return nil, nil, err
5959
}

docker/dev/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ networking settings.*
194194

195195
- Start the Agent:
196196
```
197-
vpp-agent --etcdv3-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf
197+
vpp-agent --etcd-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf
198198
```
199199

200200
### Running Etcd Server on Local Host

examples/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Current examples:
7272
Example can be started now from particular directory.
7373
```
7474
go run main.go \
75-
--etcdv3-config=/opt/vpp-agent/dev/etcd.conf \
75+
--etcd-config=/opt/vpp-agent/dev/etcd.conf \
7676
--kafka-config=/opt/vpp-agent/dev/kafka.conf
7777
```
7878
[1]: https://github.com/ligato/cn-infra/tree/master/examples

k8s/dev-setup/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ kubectl describe pods
5252

5353
Write some config into ETCD (using etcd.conf that refers to the port 22379):
5454
```
55-
export ETCDV3_CONFIG=./etcd.conf
55+
export ETCD_CONFIG=./etcd.conf
5656
../../cmd/vpp-agent-ctl/topology.sh
5757
```
5858

k8s/perf-demo/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Verify the ETCD and Kafka PODs are ready:
2323
```
2424
$ kubectl get pods
2525
NAME READY STATUS RESTARTS AGE
26-
etcdv3-server 1/1 Running 0 12s
26+
etcd-server 1/1 Running 0 12s
2727
kafka-server 1/1 Running 0 5s
2828
```
2929

@@ -59,7 +59,7 @@ Verify the PODs are ready:
5959
```
6060
$ kubectl get pods
6161
NAME READY STATUS RESTARTS AGE
62-
etcdv3-server 1/1 Running 0 33m
62+
etcd-server 1/1 Running 0 33m
6363
kafka-server 1/1 Running 0 6h
6464
vnf-vpp 1/1 Running 0 26s
6565
vswitch-vpp 1/1 Running 0 26s

k8s/perf-demo/etcd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: v1
22
kind: Pod
33
metadata:
4-
name: etcdv3-server
4+
name: etcd-server
55
spec:
66
hostNetwork: true
77
containers:
88
- image: quay.io/coreos/etcd:v3.0.16
9-
name: etcdv3
9+
name: etcd
1010
command:
1111
- /usr/local/bin/etcd
1212
- --advertise-client-urls

k8s/perf-demo/etcdimport.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ etcdKey=""
44
while read line || [[ -n "$line" ]]; do
55
if [ "${line:0:1}" != "/" ] ; then
66
value="$(echo "$line"|tr -d '\r\n')"
7-
kubectl exec etcdv3-server etcdctl -- put --endpoints=[127.0.0.1:22379] $etcdKey "$value"
7+
kubectl exec etcd-server etcdctl -- put --endpoints=[127.0.0.1:22379] $etcdKey "$value"
88
else
99
etcdKey="$(echo "$line"|tr -d '\r\n')"
1010
fi

k8s/perf-demo/with-controller/scenario1/sfc/sfc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
imagePullPolicy: IfNotPresent
1111
command:
1212
- /root/go/bin/sfc-controller
13-
- -etcdv3-config=/opt/sfc-controller/dev/etcd.conf
13+
- -etcd-config=/opt/sfc-controller/dev/etcd.conf
1414
- -sfc-config=/opt/sfc-controller/dev/sfc.conf
1515
- -vnf-config=/opt/sfc-controller/dev/vnf.conf
1616
volumeMounts:

k8s/perf-demo/with-controller/scenario2/sfc/sfc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
imagePullPolicy: IfNotPresent
1111
command:
1212
- /root/go/bin/sfc-controller
13-
- -etcdv3-config=/opt/sfc-controller/dev/etcd.conf
13+
- -etcd-config=/opt/sfc-controller/dev/etcd.conf
1414
- -sfc-config=/opt/sfc-controller/dev/sfc.conf
1515
- -vnf-config=/opt/sfc-controller/dev/vnf.conf
1616
volumeMounts:

k8s/perf-demo/with-controller/scenario23/sfc/sfc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
imagePullPolicy: IfNotPresent
1111
command:
1212
- /root/go/bin/sfc-controller
13-
- -etcdv3-config=/opt/sfc-controller/dev/etcd.conf
13+
- -etcd-config=/opt/sfc-controller/dev/etcd.conf
1414
- -sfc-config=/opt/sfc-controller/dev/sfc.conf
1515
- -vnf-config=/opt/sfc-controller/dev/vnf.conf
1616
volumeMounts:

k8s/perf-demo/with-controller/scenario4/sfc/sfc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
imagePullPolicy: IfNotPresent
1111
command:
1212
- /root/go/bin/sfc-controller
13-
- -etcdv3-config=/opt/sfc-controller/dev/etcd.conf
13+
- -etcd-config=/opt/sfc-controller/dev/etcd.conf
1414
- -sfc-config=/opt/sfc-controller/dev/sfc.conf
1515
- -vnf-config=/opt/sfc-controller/dev/vnf.conf
1616
volumeMounts:

tests/perf/vpp.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ data:
5151
priority=1
5252
5353
[program:agent]
54-
;command=/bin/vpp-agent --etcdv3-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf
55-
command=/bin/vpp-agent --etcdv3-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf --vpp-plugins-config=/opt/vpp-agent/dev/vppplugin.conf --linux-plugin-config=/opt/vpp-agent/dev/linuxplugin.conf
54+
;command=/bin/vpp-agent --etcd-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf
55+
command=/bin/vpp-agent --etcd-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf --vpp-plugins-config=/opt/vpp-agent/dev/vppplugin.conf --linux-plugin-config=/opt/vpp-agent/dev/linuxplugin.conf
5656
autorestart=false
5757
redirect_stderr=true
5858
priority=2

tests/perf/vswitch-vpp.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ data:
5050
priority=1
5151
5252
[program:agent]
53-
;command=/bin/vpp-agent --etcdv3-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf
54-
command=/bin/vpp-agent --etcdv3-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf --vpp-plugins-config=/opt/vpp-agent/dev/vppplugin.conf --linux-plugin-config=/opt/vpp-agent/dev/linuxplugin.conf
53+
;command=/bin/vpp-agent --etcd-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf
54+
command=/bin/vpp-agent --etcd-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf --vpp-plugins-config=/opt/vpp-agent/dev/vppplugin.conf --linux-plugin-config=/opt/vpp-agent/dev/linuxplugin.conf
5555
autorestart=false
5656
redirect_stderr=true
5757
priority=2

tests/robot/resources/k8-yaml/etcd_k8.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
apiVersion: v1
44
kind: Pod
55
metadata:
6-
name: etcdv3-server
6+
name: etcd-server
77
spec:
88
hostNetwork: true
99
containers:
1010
- image: quay.io/coreos/etcd:v3.0.16
11-
name: etcdv3
11+
name: etcd
1212
command:
1313
- /usr/local/bin/etcd
1414
- --advertise-client-urls

tests/robot/resources/k8-yaml/vswitch-k8.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ data:
7777
priority=1
7878
7979
[program:agent]
80-
command=/bin/vpp-agent --etcdv3-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf --vpp-plugins-config=/opt/vpp-agent/dev/vppplugin.conf --linux-plugin-config=/opt/vpp-agent/dev/linuxplugin.conf
80+
command=/bin/vpp-agent --etcd-config=/opt/vpp-agent/dev/etcd.conf --kafka-config=/opt/vpp-agent/dev/kafka.conf --vpp-plugins-config=/opt/vpp-agent/dev/vppplugin.conf --linux-plugin-config=/opt/vpp-agent/dev/linuxplugin.conf
8181
autorestart=false
8282
redirect_stderr=true
8383
priority=2

tests/robot/suites/api/management_api/management_api.robot

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Get All Loggers On ${node}
6161
Log Many ${node}
6262
${out}= rest_api: Get Loggers List agent_vpp_1
6363
Log Many ${out}
64-
Should Contain ${out} etcdv3
64+
Should Contain ${out} etcd
6565
Should Contain ${out} govpp
6666
Should Contain ${out} http
6767
Should Contain ${out} health-rpc
@@ -143,7 +143,7 @@ Get ${plugin} Plugin Status For ${node} From ETCD
143143

144144

145145
Start Agent On ${node} With Port ${port}
146-
${out}= Execute In Container ${node} vpp-agent -http-probe-port ${port} --etcdv3-config=${AGENT_VPP_ETCD_CONF_PATH} --kafka-config=${AGENT_VPP_KAFKA_CONF_PATH} &
146+
${out}= Execute In Container ${node} vpp-agent -http-probe-port ${port} --etcd-config=${AGENT_VPP_ETCD_CONF_PATH} --kafka-config=${AGENT_VPP_KAFKA_CONF_PATH} &
147147
Log Many ${out}
148148
[Return] ${out}
149149

vendor/github.com/ligato/cn-infra/db/keyval/consul/consul.conf

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ligato/cn-infra/db/keyval/etcdv3/README.md vendor/github.com/ligato/cn-infra/db/keyval/etcd/README.md

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)