INNER CODE UNIT · Go

processLBMigration

istio-ecosystem/admiral · admiral/pkg/clusters/admiralDatabaseClient.go:307

func processLBMigration(ctx context.Context, rr *RemoteRegistry, updatedLBs []string, existingCache *[]string, lbLabel string) {

	ctxLogger := log.WithField("task", common.LBUpdateProcessor)

	clusterToProcess := getLBToProcess(updatedLBs, existingCache)
	ctxLogger.Infof("ClusterToProccess=%s, LBLabel=%s", clusterToProcess, lbLabel)

	for _, cluster := range clusterToProcess {
		err := isServiceControllerInitialized(rr.remoteControllers[cluster])
		if err == nil {
			for _, fetchService := range rr.remoteControllers[cluster].ServiceController.Cache.Get(common.NamespaceIstioSystem) {
				if fetchService.Labels[common.App] == lbLabel {
					start := time.Now()
					ctxLogger.Infof("Cluster=%s, Processing LB migration for Cluster.", cluster)

					//Trigger Service event explicitly for migration
					ctx = context.WithValue(ctx, common.EventType, admiral.Update)
					err := handleEventForService(ctx, fetchService, rr, cluster)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…