SSL expiration metrics cannot be tied to dynamic updates
This commit is contained in:
parent
73d7806b48
commit
29489097c9
1 changed files with 7 additions and 7 deletions
|
@ -125,11 +125,18 @@ func (n *NGINXController) syncIngress(interface{}) error {
|
||||||
ings := n.store.ListIngresses(nil)
|
ings := n.store.ListIngresses(nil)
|
||||||
hosts, servers, pcfg := n.getConfiguration(ings)
|
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) {
|
if n.runningConfig.Equal(pcfg) {
|
||||||
klog.V(3).Infof("No configuration change detected, skipping backend reload.")
|
klog.V(3).Infof("No configuration change detected, skipping backend reload.")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n.metricCollector.SetHosts(hosts)
|
||||||
|
|
||||||
if !n.IsDynamicConfigurationEnough(pcfg) {
|
if !n.IsDynamicConfigurationEnough(pcfg) {
|
||||||
klog.Infof("Configuration changes detected, backend reload required.")
|
klog.Infof("Configuration changes detected, backend reload required.")
|
||||||
|
|
||||||
|
@ -147,16 +154,9 @@ func (n *NGINXController) syncIngress(interface{}) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
n.metricCollector.SetHosts(hosts)
|
|
||||||
|
|
||||||
klog.Infof("Backend successfully reloaded.")
|
klog.Infof("Backend successfully reloaded.")
|
||||||
n.metricCollector.ConfigSuccess(hash, true)
|
n.metricCollector.ConfigSuccess(hash, true)
|
||||||
n.metricCollector.IncReloadCount()
|
n.metricCollector.IncReloadCount()
|
||||||
|
|
||||||
if n.isLeader() {
|
|
||||||
klog.V(2).Infof("Updating ssl expiration metrics.")
|
|
||||||
n.metricCollector.SetSSLExpireTime(servers)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isFirstSync := n.runningConfig.Equal(&ingress.Configuration{})
|
isFirstSync := n.runningConfig.Equal(&ingress.Configuration{})
|
||||||
|
|
Loading…
Reference in a new issue