Skip to content

Commit

Permalink
Remove event duplication and check ingress before annotation extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Jan 24, 2018
1 parent 62622f6 commit 0836cb3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/ingress/controller/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ func New(checkOCSP bool,
glog.Infof("secret %v was removed and it is used in ingress annotations. Parsing...", key)
for _, name := range set.List() {
ing, _ := store.GetIngress(name)
store.extractAnnotations(ing)
if ing != nil {
store.extractAnnotations(ing)
}
}

updateCh <- Event{
Expand Down Expand Up @@ -399,7 +401,7 @@ func New(checkOCSP bool,
glog.V(2).Infof("adding configmap %v to backend", mapKey)
store.setConfig(m)
updateCh <- Event{
Type: CreateEvent,
Type: ConfigurationEvent,
Obj: obj,
}
}
Expand All @@ -409,15 +411,15 @@ func New(checkOCSP bool,
m := cur.(*apiv1.ConfigMap)
mapKey := fmt.Sprintf("%s/%s", m.Namespace, m.Name)
if mapKey == configmap {
glog.V(2).Infof("updating configmap backend (%v)", mapKey)
recorder.Eventf(m, apiv1.EventTypeNormal, "UPDATE", fmt.Sprintf("ConfigMap %v", mapKey))
store.setConfig(m)
updateCh <- Event{
Type: ConfigurationEvent,
Obj: cur,
}
}
// updates to configuration configmaps can trigger an update
if mapKey == configmap || mapKey == tcp || mapKey == udp {
if mapKey == tcp || mapKey == udp {
recorder.Eventf(m, apiv1.EventTypeNormal, "UPDATE", fmt.Sprintf("ConfigMap %v", mapKey))
updateCh <- Event{
Type: ConfigurationEvent,
Expand Down

0 comments on commit 0836cb3

Please sign in to comment.