(ipAddress string, port int, transaction string, version int64)
| 227 | } |
| 228 | |
| 229 | func (api *API) removeServerByName(ipAddress string, port int, transaction string, version int64) { |
| 230 | url := fmt.Sprintf("%s:%d", ipAddress, port) |
| 231 | |
| 232 | api.mutex.Lock() |
| 233 | defer api.mutex.Unlock() |
| 234 | |
| 235 | if dataplaneName, ok := api.addressToName[url]; !ok { |
| 236 | return |
| 237 | } else { |
| 238 | err := api.client.Configuration.DeleteServer(dataplaneName, DataplaneBackend, transaction, version) |
| 239 | if err != nil { |
| 240 | logrus.Errorf("Error removing server with name %s from the load balancer - %v", dataplaneName, err) |
| 241 | } |
| 242 | |
| 243 | delete(api.addressToName, url) |
| 244 | logrus.Infof("Removed data plane with address %s:%d to HAProxy backend.", ipAddress, port) |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | func (api *API) removeRegistrationServers(transaction string) { |
| 249 | _, servers, err := api.client.Configuration.GetServers(RegistrationServerBackend, transaction) |
no test coverage detected