Skip to content

Commit

Permalink
Refactor reconcilers and implementations (nginx#250)
Browse files Browse the repository at this point in the history
Previously, all reconcilers and implementations looked almost the same.

This commit:
- Replaces all reconcilers with a single one.
- Removes all implementations. Now the reconciler sends upsert and
delete events to the event channel instead of the implementations.
The sending to the events part of the reconciler doesn't have
the shutdown bug (a possibility to hang while sending to the channel
during the shutdown) all implementations shared.
- Removes the sdk package.

Additionally, the Manager now uses the same logger as the other
components.
  • Loading branch information
miledxz committed Oct 14, 2022
1 parent 0f4d163 commit ec53518
Show file tree
Hide file tree
Showing 44 changed files with 2,381 additions and 1,158 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/onsi/ginkgo/v2 v2.3.1
github.com/onsi/gomega v1.22.1
github.com/spf13/pflag v1.0.5
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
k8s.io/api v0.25.3
k8s.io/apimachinery v0.25.3
k8s.io/client-go v0.25.3
sigs.k8s.io/controller-runtime v0.13.0
sigs.k8s.io/gateway-api v0.5.1
)
Expand Down Expand Up @@ -55,6 +55,7 @@ require (
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
Expand All @@ -69,7 +70,6 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.0 // indirect
k8s.io/client-go v0.25.0 // indirect
k8s.io/component-base v0.25.0 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTC
k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E=
k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc=
k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo=
k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E=
k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8=
k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0=
k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA=
k8s.io/component-base v0.25.0 h1:haVKlLkPCFZhkcqB6WCvpVxftrg6+FK5x1ZuaIDaQ5Y=
k8s.io/component-base v0.25.0/go.mod h1:F2Sumv9CnbBlqrpdf7rKZTmmd2meJq0HizeyY/yAFxk=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
Expand Down
48 changes: 0 additions & 48 deletions internal/implementations/endpointslice/endpointslice.go

This file was deleted.

64 changes: 0 additions & 64 deletions internal/implementations/endpointslice/endpointslice_test.go

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions internal/implementations/gateway/gateway.go

This file was deleted.

61 changes: 0 additions & 61 deletions internal/implementations/gateway/gateway_test.go

This file was deleted.

13 changes: 0 additions & 13 deletions internal/implementations/gateway/implementation_suite_test.go

This file was deleted.

64 changes: 0 additions & 64 deletions internal/implementations/gatewayclass/gatewayclass.go

This file was deleted.

Loading

0 comments on commit ec53518

Please sign in to comment.