Skip to content

Commit

Permalink
fixup! fixup! fixup! feat: ipam sync routine
Browse files Browse the repository at this point in the history
  • Loading branch information
fra98 committed Nov 6, 2024
1 parent 0628f19 commit a56be98
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/ipam/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
func (lipam *LiqoIPAM) sync(ctx context.Context, syncFrequency time.Duration) {
err := wait.PollUntilContextCancel(ctx, syncFrequency, false,
func(ctx context.Context) (done bool, err error) {
klog.Info("Started IPAM cache sync routine")
now := time.Now()
// networks created before this threshold will be removed from the cache if they are not present in the cluster.
expiredThreshold := now.Add(-syncFrequency)
Expand All @@ -43,10 +44,11 @@ func (lipam *LiqoIPAM) sync(ctx context.Context, syncFrequency time.Duration) {
return false, err
}

klog.Info("Completed IPAM cache sync routine")
return false, nil
})
if err != nil {
klog.Error(err)
klog.Errorf("IPAM cache sync routine failed: %v", err)
os.Exit(1)
}
}
Expand Down

0 comments on commit a56be98

Please sign in to comment.