@@ -21,7 +21,7 @@ import (
21
21
"fmt"
22
22
23
23
"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 "
25
25
"github.com/ligato/cn-infra/db/keyval/kvproto"
26
26
"github.com/ligato/cn-infra/logging"
27
27
"github.com/ligato/cn-infra/logging/logrus"
@@ -163,48 +163,48 @@ func rebuildName(params []string) string {
163
163
}
164
164
165
165
// 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.
167
167
func GetDbForAllAgents (endpoints []string ) (keyval.ProtoBroker , error ) {
168
168
if len (endpoints ) > 0 {
169
169
ep := strings .Join (endpoints , "," )
170
- os .Setenv ("ETCDV3_ENDPOINTS " , ep )
170
+ os .Setenv ("ETCD_ENDPOINTS " , ep )
171
171
}
172
172
173
- cfg := & etcdv3 .Config {}
174
- etcdConfig , err := etcdv3 .ConfigToClient (cfg )
173
+ cfg := & etcd .Config {}
174
+ etcdConfig , err := etcd .ConfigToClient (cfg )
175
175
176
176
// Log warnings and errors only.
177
177
log := logrus .DefaultLogger ()
178
178
log .SetLevel (logging .WarnLevel )
179
- etcdv3Broker , err := etcdv3 .NewEtcdConnectionWithBytes (* etcdConfig , log )
179
+ etcdBroker , err := etcd .NewEtcdConnectionWithBytes (* etcdConfig , log )
180
180
if err != nil {
181
181
return nil , err
182
182
}
183
183
184
- return kvproto .NewProtoWrapperWithSerializer (etcdv3Broker , & keyval.SerializerJSON {}), nil
184
+ return kvproto .NewProtoWrapperWithSerializer (etcdBroker , & keyval.SerializerJSON {}), nil
185
185
186
186
}
187
187
188
188
// 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.
190
190
func GetDbForOneAgent (endpoints []string , agentLabel string ) (keyval.ProtoBroker , error ) {
191
191
if len (endpoints ) > 0 {
192
192
ep := strings .Join (endpoints , "," )
193
- os .Setenv ("ETCDV3_ENDPOINTS " , ep )
193
+ os .Setenv ("ETCD_ENDPOINTS " , ep )
194
194
}
195
195
196
- cfg := & etcdv3 .Config {}
197
- etcdConfig , err := etcdv3 .ConfigToClient (cfg )
196
+ cfg := & etcd .Config {}
197
+ etcdConfig , err := etcd .ConfigToClient (cfg )
198
198
199
199
// Log warnings and errors only.
200
200
log := logrus .DefaultLogger ()
201
201
log .SetLevel (logging .WarnLevel )
202
- etcdv3Broker , err := etcdv3 .NewEtcdConnectionWithBytes (* etcdConfig , log )
202
+ etcdBroker , err := etcd .NewEtcdConnectionWithBytes (* etcdConfig , log )
203
203
if err != nil {
204
204
return nil , err
205
205
}
206
206
207
- return kvproto .NewProtoWrapperWithSerializer (etcdv3Broker , & keyval.SerializerJSON {}).
207
+ return kvproto .NewProtoWrapperWithSerializer (etcdBroker , & keyval.SerializerJSON {}).
208
208
NewBroker (servicelabel .GetAllAgentsPrefix () + agentLabel + "/" ), nil
209
209
210
210
}
0 commit comments