Skip to content

Commit

Permalink
at the start of polling getting the current state
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 committed Dec 11, 2023
1 parent d84ad22 commit a32b98b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/event_listener/polling/polling.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package polling

import (
"github.com/port-labs/port-k8s-exporter/pkg/port"
"github.com/port-labs/port-k8s-exporter/pkg/port/cli"
"github.com/port-labs/port-k8s-exporter/pkg/port/integration"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -29,7 +28,10 @@ func NewPollingHandler(pollingRate int, stateKey string, portClient *cli.PortCli

func (h *PollingHandler) Run(resync func()) {
klog.Infof("Starting polling handler")
currentState := &port.AppConfig{}
currentState, err := integration.GetIntegrationConfig(h.portClient, h.stateKey)
if err != nil {
klog.Errorf("Error fetching the first AppConfig state: %s", err.Error())
}

sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
Expand Down

0 comments on commit a32b98b

Please sign in to comment.