1
0
mirror of https://github.com/rancher/types.git synced 2025-09-13 13:33:06 +00:00

Update vendor

This commit is contained in:
Darren Shepherd
2017-11-28 19:02:51 -07:00
parent 6bef2175e1
commit 3b076deeab
3 changed files with 11 additions and 3 deletions

View File

@@ -3,5 +3,5 @@ github.com/rancher/types
k8s.io/kubernetes v1.8.3 transitive=true,staging=true
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
github.com/rancher/norman 391a96f33dd0b1f893f8b194e2d7cad3e26d1351
github.com/rancher/norman ee148b4d18535ee26bce4b90380d91a1d9e4ac15
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5

View File

@@ -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

View File

@@ -11,8 +11,15 @@ type Starter interface {
Start(ctx context.Context, threadiness int) error
}
func SyncThenSync(ctx context.Context, threadiness int, starters ...Starter) error {
if err := Sync(ctx, starters...); err != nil {
return err
}
return Start(ctx, threadiness, starters...)
}
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 {