Refactor metric prometheus leader helper

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-06-28 18:29:58 -04:00
parent 7c6ffeaeac
commit ccd88f625c
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
3 changed files with 28 additions and 21 deletions

View file

@ -124,10 +124,7 @@ func (n *NGINXController) syncIngress(interface{}) error {
ings := n.store.ListIngresses(nil)
hosts, servers, pcfg := n.getConfiguration(ings)
if n.isLeader() {
klog.V(2).Infof("Updating ssl expiration metrics.")
n.metricCollector.SetSSLExpireTime(servers)
}
n.metricCollector.SetSSLExpireTime(servers)
if n.runningConfig.Equal(pcfg) {
klog.V(3).Infof("No configuration change detected, skipping backend reload.")