diff --git a/appruntimesync/clean/clean.go b/appruntimesync/clean/clean.go index 1f66d3d17..40ebff4e7 100644 --- a/appruntimesync/clean/clean.go +++ b/appruntimesync/clean/clean.go @@ -544,10 +544,11 @@ type Manager struct { dclient *client.Client } -func NewManager(ctx context.Context, kubeclient *kubernetes.Clientset) (*Manager, error) { +func NewManager(ctx context.Context, cancel context.CancelFunc, kubeclient *kubernetes.Clientset) (*Manager, error) { m := &Manager{ ctx: ctx, kubeclient: kubeclient, + cancel: cancel, } queryResource := []func(*Manager) []Resource{ QueryRcResource, diff --git a/appruntimesync/server/server.go b/appruntimesync/server/server.go index 6b9684534..4fac784d5 100644 --- a/appruntimesync/server/server.go +++ b/appruntimesync/server/server.go @@ -62,8 +62,8 @@ func NewAppRuntimeSyncServer(conf option.Config) *AppRuntimeSyncServer { statusManager := status.NewManager(ctx, clientset) stopChan := make(chan struct{}) podCache := pod.NewCacheManager(clientset) - Clean,err := clean.NewManager(ctx, clientset) - if err!= nil{ + Clean, err := clean.NewManager(ctx, cancel, clientset) + if err != nil { logrus.Error(err) } arss := &AppRuntimeSyncServer{