Add informers and internal go routines in manager (#2870)
* used manager's Add function in more places * exit when ctx.Done is received in archivePruner go routines * fix manager tests * fix data race * added more gpm function in manager and removed manager from a util function * closed unused channel and stopped ticker after context is done * added log statements * used context.Done inside function instead of stopper channel
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
"github.com/fission/fission/pkg/utils/manager"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -51,10 +52,8 @@ func MakeWatchSync(ctx context.Context, logger *zap.Logger, client versioned.Int
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
func (ws *WatchSync) Run(ctx context.Context) {
|
||||
for _, informer := range ws.kubeWatcherInformer {
|
||||
go informer.Run(ctx.Done())
|
||||
}
|
||||
func (ws *WatchSync) Run(ctx context.Context, mgr manager.Interface) {
|
||||
mgr.AddInformers(ctx, ws.kubeWatcherInformer)
|
||||
}
|
||||
|
||||
func (ws *WatchSync) KubeWatcherEventHandlers(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user