Skip to content

Commit

Permalink
Cleanup completed pods correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed Aug 12, 2024
1 parent 4b2feea commit dc613b9
Show file tree
Hide file tree
Showing 6 changed files with 289 additions and 160 deletions.
3 changes: 2 additions & 1 deletion cmd/exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ func run(log logrus.FieldLogger) error {
informersFactory := informers.NewSharedInformerFactoryWithOptions(clientset, 30*time.Second)
podsInformer := informersFactory.Core().V1().Pods().Informer()
nodesInformer := informersFactory.Core().V1().Nodes().Informer()
podByIPCache := kube.NewPodByIPCache(ctx, podsInformer, log)
podByIPCache := kube.NewPodByIPCache(podsInformer, log)
go podByIPCache.Run(ctx)
nodeByNameCache := kube.NewNodeByNameCache(nodesInformer)
nodeByIPCache := kube.NewNodeByIPCache(nodesInformer)
informersFactory.Start(wait.NeverStop)
Expand Down
32 changes: 16 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/castai/egressd

go 1.21.0
go 1.22.0

toolchain go1.21.6
toolchain go1.22.3

require (
github.com/Code-Hex/go-generics-cache v1.3.1
Expand All @@ -19,13 +19,13 @@ require (
github.com/stretchr/testify v1.8.4
github.com/vishvananda/netns v0.0.4
golang.org/x/sync v0.3.0
golang.org/x/sys v0.15.0
golang.org/x/sys v0.18.0
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v3 v3.0.1
inet.af/netaddr v0.0.0-20220811202034-502d2d690317
k8s.io/api v0.27.6
k8s.io/apimachinery v0.27.6
k8s.io/client-go v0.27.6
k8s.io/api v0.30.3
k8s.io/apimachinery v0.30.3
k8s.io/client-go v0.30.3
)

require (
Expand All @@ -37,24 +37,24 @@ require (
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.26.0 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/strfmt v0.21.7 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand Down Expand Up @@ -106,20 +106,20 @@ require (
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

Expand Down
Loading

0 comments on commit dc613b9

Please sign in to comment.