observatorium / thanos-receive-controller

Kubernetes controller to automatically configure Thanos receive hashrings
Apache License 2.0
93 stars 42 forks source link

main.go: move to informer pattern #7

Closed squat closed 5 years ago

squat commented 5 years ago

This commit refactors the controller to use the standard k8s informer pattern. Using this pattern makes the code somewhat more compact since all of the watching is abstracted away.

This commit also adds complete unit tests that run the controller against a mocked API.

cc @metalmatze

brancz commented 5 years ago

love it, lgtm :+1: