MCPcopy
hub / github.com/google/seesaw / down

Method down

engine/vserver.go:1269–1295  ·  view source on GitHub ↗

down takes down an IP address for a vserver, then takes down all services for that IP address.

(ip seesaw.IP)

Source from the content-addressed store, hash-verified

1267// down takes down an IP address for a vserver, then takes down all services
1268// for that IP address.
1269func (v *vserver) down(ip seesaw.IP) {
1270 ncc := v.ncc
1271
1272 // If this is an anycast VIP, withdraw the BGP route.
1273 nip := ip.IP()
1274 if seesaw.IsAnycast(nip) {
1275 if v.engine.config.AnycastEnabled {
1276 log.Infof("%v: withdrawing BGP route for %v", v, ip)
1277 if err := ncc.BGPWithdrawVIP(nip); err != nil {
1278 log.Fatalf("%v: failed to withdraw VIP %v: %v", v, ip, err)
1279 }
1280 }
1281 vip := seesaw.NewVIP(nip, nil)
1282 if err := v.engine.lbInterface.DeleteVIP(vip); err != nil {
1283 log.Fatalf("%v: failed to remove VIP %v: %v", v, ip, err)
1284 }
1285 if err := v.engine.lbInterface.DeleteVserver(v.lbVservers[ip], ip.AF()); err != nil {
1286 log.Fatalf("%v: failed to delete Vserver: %v", v, err)
1287 }
1288 delete(v.lbVservers, ip)
1289 }
1290 // TODO(jsing): Should we delay while the BGP routes propagate?
1291
1292 delete(v.active, ip)
1293 v.updateServices(ip)
1294 log.Infof("%v: VIP %v down", v, ip)
1295}
1296
1297// updateStats updates the IPVS statistics for this vserver.
1298func (v *vserver) updateStats() {

Callers 3

updateStateMethod · 0.95
updateServicesMethod · 0.95
downAllMethod · 0.95

Calls 8

updateServicesMethod · 0.95
IsAnycastFunction · 0.92
NewVIPFunction · 0.92
AFMethod · 0.80
BGPWithdrawVIPMethod · 0.65
DeleteVIPMethod · 0.65
DeleteVserverMethod · 0.65
IPMethod · 0.45

Tested by

no test coverage detected