Skip to content

Commit

Permalink
chore: addressing pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardomaraschini committed May 6, 2024
1 parent 191861a commit 36ce83b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/component/worker/ocibundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewOCIBundleReconciler(vars *config.CfgVars) *OCIBundleReconciler {
log: logrus.WithField("component", "OCIBundleReconciler"),
EventEmitter: prober.NewEventEmitter(),
alreadyImported: map[string]time.Time{},
end: make(chan struct{}, 1),
end: make(chan struct{}),
}
}

Expand Down Expand Up @@ -178,11 +178,13 @@ func (a *OCIBundleReconciler) installWatcher(ctx context.Context) error {
}()

go func() {
defer close(a.end)
a.log.Infof("Started to watch events on %s", a.k0sVars.OCIBundleDir)
_ = debouncer.Run(ctx)
watcher.Close()
if err := watcher.Close(); err != nil {
a.log.Errorf("Failed to close watcher: %s", err)
}
a.log.Info("OCI bundle watch bouncer ended")
a.end <- struct{}{}
}()

return nil
Expand Down

0 comments on commit 36ce83b

Please sign in to comment.