MCPcopy
hub / github.com/istio/istio / initControllers

Method initControllers

pilot/pkg/bootstrap/server.go:1166–1196  ·  view source on GitHub ↗

initControllers initializes the controllers.

(args *PilotArgs)

Source from the content-addressed store, hash-verified

1164
1165// initControllers initializes the controllers.
1166func (s *Server) initControllers(args *PilotArgs) error {
1167 log.Info("initializing controllers")
1168 s.initMulticluster(args)
1169
1170 s.initSDSServer()
1171
1172 if features.EnableNodeUntaintControllers {
1173 s.initNodeUntaintController(args)
1174 }
1175
1176 if features.EnableIPAutoallocate {
1177 // validate the IP autoallocate CIDR prefixes for IPv4 and IPv6
1178 if _, err := netip.ParsePrefix(features.IPAutoallocateIPv4Prefix); err != nil {
1179 return fmt.Errorf("invalid IPv4 prefix %s: %v", features.IPAutoallocateIPv4Prefix, err)
1180 }
1181 if _, err := netip.ParsePrefix(features.IPAutoallocateIPv6Prefix); err != nil {
1182 return fmt.Errorf("invalid IPv6 prefix %s: %v", features.IPAutoallocateIPv6Prefix, err)
1183 }
1184 s.initIPAutoallocateController(args)
1185 }
1186
1187 s.initKubeOptions(args)
1188
1189 if err := s.initConfigController(args); err != nil {
1190 return fmt.Errorf("error initializing config controller: %v", err)
1191 }
1192 if err := s.initServiceControllers(args); err != nil {
1193 return fmt.Errorf("error initializing service controllers: %v", err)
1194 }
1195 return nil
1196}
1197
1198func (s *Server) initNodeUntaintController(args *PilotArgs) {
1199 if s.kubeClient == nil {

Callers 1

NewServerFunction · 0.95

Calls 9

initMulticlusterMethod · 0.95
initSDSServerMethod · 0.95
initKubeOptionsMethod · 0.95
initConfigControllerMethod · 0.95
InfoFunction · 0.92
ErrorfMethod · 0.65

Tested by

no test coverage detected