stakater / IngressMonitorController

A Kubernetes controller to watch ingresses and create liveness alerts for your apps/microservices in UptimeRobot, StatusCake, Pingdom, etc. – [✩Star] if you're using it!
https://stakater.com
Apache License 2.0
599 stars 104 forks source link

Statuscake: Implement Equals function using TestTags #610

Open matthijswolters-rl opened 3 weeks ago

matthijswolters-rl commented 3 weeks ago

This PR implements the Equals function in the statuscake operator. This ensures that the operator does not update all uptime checks during every round. Which could cause ratelimiting from Statuscake. My consideration for this implementation can be found below.

It is mentioned in a comment in the code itself but because of the discrepency between the fields in the EndpointMonitor CR and the Statuscake API it is not immediately clear how to compare an old monitor with an updated monitor. The way I have elected to check this is to use the TestTags field to include some kind of identifier that should be updated on any change. So if the tags have changed then the monitor should be updated.

I have added a comment in code to explain the reason for the implementation. Let me know if you have any other questions.