Merge pull request #4160 from aledbf/fix-expire-metric

SSL expiration metrics cannot be tied to dynamic updates
This commit is contained in:
Kubernetes Prow Robot 2019-06-06 06:24:13 -07:00 committed by GitHub
commit 79e214c5b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,11 +125,18 @@ 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)
}
if n.runningConfig.Equal(pcfg) {
klog.V(3).Infof("No configuration change detected, skipping backend reload.")
return nil
}
n.metricCollector.SetHosts(hosts)
if !n.IsDynamicConfigurationEnough(pcfg) {
klog.Infof("Configuration changes detected, backend reload required.")
@ -147,16 +154,9 @@ func (n *NGINXController) syncIngress(interface{}) error {
return err
}
n.metricCollector.SetHosts(hosts)
klog.Infof("Backend successfully reloaded.")
n.metricCollector.ConfigSuccess(hash, true)
n.metricCollector.IncReloadCount()
if n.isLeader() {
klog.V(2).Infof("Updating ssl expiration metrics.")
n.metricCollector.SetSSLExpireTime(servers)
}
}
isFirstSync := n.runningConfig.Equal(&ingress.Configuration{})