Skip to content

Commit

Permalink
assets and docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 committed Dec 28, 2023
1 parent 8ea77e4 commit 31c9f7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM gcr.io/distroless/static-debian11

COPY assets /usr/bin/assets

USER nonroot:nonroot

ENTRYPOINT ["/usr/bin/port-k8s-exporter"]
Expand Down
5 changes: 4 additions & 1 deletion pkg/event_handler/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ type IStoppableRsync interface {
func Start(eventListener IListener, initControllerHandler func() (IStoppableRsync, error)) error {
controllerHandler, err := initControllerHandler()
if err != nil {
return err
utilruntime.HandleError(fmt.Errorf("error resyncing: %s", err.Error()))
}

return eventListener.Run(func() {
klog.Infof("Resync request received. Recreating controllers for the new port configuration")
if controllerHandler != nil {
controllerHandler.Stop()
}
controllerHandler.Stop()
newController, resyncErr := initControllerHandler()
controllerHandler = newController
Expand Down

0 comments on commit 31c9f7c

Please sign in to comment.