mirror of
https://github.com/rancher/norman.git
synced 2025-08-17 14:56:42 +00:00
Fix startup issues
This commit is contained in:
parent
391a96f33d
commit
247d4fe74b
@ -98,13 +98,14 @@ func (g *genericController) sync(ctx context.Context) error {
|
|||||||
DeleteFunc: g.queueObject,
|
DeleteFunc: g.queueObject,
|
||||||
})
|
})
|
||||||
|
|
||||||
logrus.Infof("Starting %s Controller", g.name)
|
logrus.Infof("Syncing %s Controller", g.name)
|
||||||
|
|
||||||
go g.informer.Run(ctx.Done())
|
go g.informer.Run(ctx.Done())
|
||||||
|
|
||||||
if !cache.WaitForCacheSync(ctx.Done(), g.informer.HasSynced) {
|
if !cache.WaitForCacheSync(ctx.Done(), g.informer.HasSynced) {
|
||||||
return fmt.Errorf("failed to sync controller %s", g.name)
|
return fmt.Errorf("failed to sync controller %s", g.name)
|
||||||
}
|
}
|
||||||
|
logrus.Infof("Syncing %s Controller Done", g.name)
|
||||||
|
|
||||||
g.synced = true
|
g.synced = true
|
||||||
return nil
|
return nil
|
||||||
|
@ -12,7 +12,7 @@ type Starter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Sync(ctx context.Context, starters ...Starter) error {
|
func Sync(ctx context.Context, starters ...Starter) error {
|
||||||
eg, ctx := errgroup.WithContext(ctx)
|
eg, _ := errgroup.WithContext(ctx)
|
||||||
for _, starter := range starters {
|
for _, starter := range starters {
|
||||||
func(starter Starter) {
|
func(starter Starter) {
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
|
@ -134,8 +134,8 @@ func (c *Store) AddSchemas(ctx context.Context, schemas ...*types.Schema) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
for schema, crd := range schemaStatus {
|
for schema, crd := range schemaStatus {
|
||||||
if crd, ok := ready[crd.Name]; ok {
|
if readyCrd, ok := ready[crd.Name]; ok {
|
||||||
schemaStatus[schema] = crd
|
schemaStatus[schema] = readyCrd
|
||||||
} else {
|
} else {
|
||||||
if err := c.waitCRD(ctx, crd.Name, schema, schemaStatus); err != nil {
|
if err := c.waitCRD(ctx, crd.Name, schema, schemaStatus); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user