diff --git a/controller/generic_controller.go b/controller/generic_controller.go index a1f4816f..dde151c0 100644 --- a/controller/generic_controller.go +++ b/controller/generic_controller.go @@ -98,13 +98,14 @@ func (g *genericController) sync(ctx context.Context) error { DeleteFunc: g.queueObject, }) - logrus.Infof("Starting %s Controller", g.name) + logrus.Infof("Syncing %s Controller", g.name) go g.informer.Run(ctx.Done()) if !cache.WaitForCacheSync(ctx.Done(), g.informer.HasSynced) { return fmt.Errorf("failed to sync controller %s", g.name) } + logrus.Infof("Syncing %s Controller Done", g.name) g.synced = true return nil diff --git a/controller/starter.go b/controller/starter.go index 3a735de9..31cc069d 100644 --- a/controller/starter.go +++ b/controller/starter.go @@ -12,7 +12,7 @@ type Starter interface { } func Sync(ctx context.Context, starters ...Starter) error { - eg, ctx := errgroup.WithContext(ctx) + eg, _ := errgroup.WithContext(ctx) for _, starter := range starters { func(starter Starter) { eg.Go(func() error { diff --git a/store/crd/crd_store.go b/store/crd/crd_store.go index 07c7c681..0d06834b 100644 --- a/store/crd/crd_store.go +++ b/store/crd/crd_store.go @@ -134,8 +134,8 @@ func (c *Store) AddSchemas(ctx context.Context, schemas ...*types.Schema) error } for schema, crd := range schemaStatus { - if crd, ok := ready[crd.Name]; ok { - schemaStatus[schema] = crd + if readyCrd, ok := ready[crd.Name]; ok { + schemaStatus[schema] = readyCrd } else { if err := c.waitCRD(ctx, crd.Name, schema, schemaStatus); err != nil { return err