Skip to content

Commit aa17c85

Browse files
committed
missed merge
1 parent ff7edf1 commit aa17c85

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

netmaster/master/provider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func SvcProviderUpdate(serviceID string, isDelete bool) error {
6464
}
6565

6666
func getProviderID(provider *mastercfg.Provider) string {
67-
return provider.IPAddress + "\\" + provider.Tenant
67+
return provider.IPAddress + ":" + provider.Tenant
6868
}
6969

7070
func getProviderDbID(provider *mastercfg.Provider) string {

netmaster/master/servicelb.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ func CreateServiceLB(stateDriver core.StateDriver, serviceLbCfg *intent.ConfigSe
3030
var providersPresent bool
3131
serviceIP := serviceLbCfg.IPAddress
3232
log.Infof("Recevied Create Service Load Balancer config {%v}", serviceLbCfg)
33-
34-
oldServiceInfo := mastercfg.ServiceLBDb[serviceLbCfg.ServiceName+"\\"+serviceLbCfg.Tenant]
33+
svcID := getServiceID(serviceLbCfg.ServiceName, serviceLbCfg.Tenant)
34+
oldServiceInfo := mastercfg.ServiceLBDb[svcID]
3535
if oldServiceInfo != nil {
3636
//ServiceInfo Exists
3737
if reflect.DeepEqual(oldServiceInfo.Ports, serviceLbCfg.Ports) &&
@@ -47,7 +47,7 @@ func CreateServiceLB(stateDriver core.StateDriver, serviceLbCfg *intent.ConfigSe
4747
serviceLbState.Tenant = serviceLbCfg.Tenant
4848
serviceLbState.Network = serviceLbCfg.Network
4949
serviceLbState.StateDriver = stateDriver
50-
serviceLbState.ID = serviceLbCfg.ServiceName + "\\" + serviceLbCfg.Tenant
50+
serviceLbState.ID = getServiceID(serviceLbCfg.ServiceName, serviceLbCfg.Tenant)
5151
serviceLbState.Ports = append(serviceLbState.Ports, serviceLbCfg.Ports...)
5252
serviceLbState.Selectors = make(map[string]string)
5353
serviceLbState.Providers = make(map[string]*mastercfg.Provider)
@@ -132,7 +132,7 @@ func DeleteServiceLB(stateDriver core.StateDriver, serviceName string, tenantNam
132132
log.Infof("Receiver Delete Service Load Balancer %s on %s", serviceName, tenantName)
133133
serviceLBState := &mastercfg.CfgServiceLBState{}
134134
serviceLBState.StateDriver = stateDriver
135-
serviceLBState.ID = serviceName + "\\" + tenantName
135+
serviceLBState.ID = getServiceID(serviceName, tenantName)
136136

137137
err := serviceLBState.Read(serviceLBState.ID)
138138
if err != nil {
@@ -182,7 +182,7 @@ func DeleteServiceLB(stateDriver core.StateDriver, serviceName string, tenantNam
182182
}
183183

184184
func getServiceID(servicename string, tenantname string) string {
185-
return servicename + "\\" + tenantname
185+
return servicename + ":" + tenantname
186186
}
187187

188188
//RestoreServiceProviderLBDb restores provider and servicelb db
@@ -202,7 +202,7 @@ func RestoreServiceProviderLBDb() {
202202
for _, svcLBCfg := range svcLBCfgs {
203203
svcLB := svcLBCfg.(*mastercfg.CfgServiceLBState)
204204
//mastercfg.ServiceLBDb = make(map[string]*mastercfg.ServiceLBInfo)
205-
serviceID := svcLB.ServiceName + "\\" + svcLB.Tenant
205+
serviceID := getServiceID(svcLB.ServiceName, svcLB.Tenant)
206206
mastercfg.ServiceLBDb[serviceID] = &mastercfg.ServiceLBInfo{
207207
IPAddress: svcLB.IPAddress,
208208
Tenant: svcLB.Tenant,

netmaster/objApi/objapi_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ func verifyServiceCreate(t *testing.T, tenant, network, serviceName string, port
808808

809809
err = serviceLbState.Read(serviceLbState.ID)
810810
if err != nil {
811-
t.Fatalf("Error reading from service load balancer state")
811+
t.Fatalf("Error reading from service load balancer state:%s", err)
812812
}
813813

814814
if serviceLbState.IPAddress == "" {

0 commit comments

Comments
 (0)