vmware-archive / eventrouter

A simple introspective kubernetes service that forwards events to a specified sink.
Apache License 2.0
883 stars 252 forks source link

Fix Prometheus Events #94

Closed cyrus-mc closed 4 years ago

cyrus-mc commented 4 years ago

A flag was added to enable/disable prometheus events. The logic for this was in the init function within eventrouter.go. With the way loadConfig is currently written the init function fires first, meaning the configuration isn't processed thus prometheus is always disabled.

cyrus-mc commented 4 years ago

Fix for #89

johnSchnake commented 4 years ago

@cyrus-mc Please squash your commits and ensure it is signed.

blakeroberts-wk commented 4 years ago

@cyrus-mc

I did not consider this. My bad. Perhaps loadConfig should be moved to an init func in main.go? I made a poor assumption around how viper and init is usually done which lead to this oversight. Perhaps we avoid future issues by loading the config at the very very beginning of execution

johnSchnake commented 4 years ago

ping @cyrus-mc ; please sign your commit, I really need to get this fix in for a release to be cut.

johnSchnake commented 4 years ago

Trivial sized PR with clear resolution; I just fixed it separately on my own branch and pushed a PR here: https://github.com/heptiolabs/eventrouter/pull/98

johnSchnake commented 4 years ago

Thanks for finding this issue though @cyrus-mc ; sorry for moving ahead with the fix but I wanted to unblock things for a release.