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

Method configInit

engine/vserver.go:626–648  ·  view source on GitHub ↗

configInit initialises all services, destinations, healthchecks and VIPs for a vserver.

(config *config.Vserver)

Source from the content-addressed store, hash-verified

624// configInit initialises all services, destinations, healthchecks and VIPs for
625// a vserver.
626func (v *vserver) configInit(config *config.Vserver) {
627 v.config = config
628 v.enabled = vserverEnabled(config, v.vserverOverride.State())
629 newSvcs := v.expandServices()
630 // Preserve stats if this is a reinit
631 for svcK, svc := range newSvcs {
632 svc.dests = v.expandDests(svc)
633 if oldSvc, ok := v.services[svcK]; ok {
634 *svc.stats = *oldSvc.stats
635 for dstK, dst := range svc.dests {
636 if oldDst, ok := oldSvc.dests[dstK]; ok {
637 *dst.stats = *oldDst.stats
638 }
639 }
640 }
641 }
642 v.services = newSvcs
643 v.checks = v.expandChecks()
644 if v.enabled {
645 v.configureVIPs()
646 }
647 return
648}
649
650// configUpdate updates the services, destinations, checks, and VIPs for a
651// vserver.

Callers 1

handleConfigUpdateMethod · 0.95

Calls 6

expandServicesMethod · 0.95
expandDestsMethod · 0.95
expandChecksMethod · 0.95
configureVIPsMethod · 0.95
vserverEnabledFunction · 0.85
StateMethod · 0.65

Tested by

no test coverage detected