Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Configmap/Mergeable Ingress Add/Update event logging #386

Merged
merged 3 commits into from
Oct 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,22 +368,22 @@ func (lbc *LoadBalancerController) syncConfig(task queue.Task) {
if updateErr != nil {
eventTitle = "UpdatedWithError"
eventType = api_v1.EventTypeWarning
eventWarningMessage = "but was not applied"
eventWarningMessage = fmt.Sprintf("but was not applied: %v", updateErr)
}
if configExists {
cfgm := obj.(*api_v1.ConfigMap)
lbc.recorder.Eventf(cfgm, eventType, eventTitle, "Configuration from %v was updated %s: %v", key, eventWarningMessage, err)
lbc.recorder.Eventf(cfgm, eventType, eventTitle, "Configuration from %v was updated %s", key, eventWarningMessage)
}
for _, ingEx := range ingExes {
lbc.recorder.Eventf(ingEx.Ingress, eventType, eventTitle, "Configuration for %v/%v was updated %s: %v",
ingEx.Ingress.Namespace, ingEx.Ingress.Name, eventWarningMessage, err)
lbc.recorder.Eventf(ingEx.Ingress, eventType, eventTitle, "Configuration for %v/%v was updated %s",
ingEx.Ingress.Namespace, ingEx.Ingress.Name, eventWarningMessage)
}
for _, mergeableIng := range mergeableIngresses {
master := mergeableIng.Master
lbc.recorder.Eventf(master.Ingress, eventType, eventTitle, "Configuration for %v/%v(Master) was updated %s: %v", master.Ingress.Namespace, master.Ingress.Name, eventWarningMessage, err)
lbc.recorder.Eventf(master.Ingress, eventType, eventTitle, "Configuration for %v/%v(Master) was updated %s", master.Ingress.Namespace, master.Ingress.Name, eventWarningMessage)
for _, minion := range mergeableIng.Minions {
lbc.recorder.Eventf(minion.Ingress, eventType, eventTitle, "Configuration for %v/%v(Minion) was updated %s: %v",
minion.Ingress.Namespace, minion.Ingress.Name, eventWarningMessage, err)
lbc.recorder.Eventf(minion.Ingress, eventType, eventTitle, "Configuration for %v/%v(Minion) was updated %s",
minion.Ingress.Namespace, minion.Ingress.Name, eventWarningMessage)
}
}
}
Expand Down Expand Up @@ -533,11 +533,11 @@ func (lbc *LoadBalancerController) syncIng(task queue.Task) {
if addErr != nil {
eventTitle = "AddedOrUpdatedWithError"
eventType = api_v1.EventTypeWarning
eventWarningMessage = "but was not applied"
eventWarningMessage = fmt.Sprintf("but was not applied: %v", addErr)
}
lbc.recorder.Eventf(ing, eventType, eventTitle, "Configuration for %v(Master) was added or updated %s: %v", key, eventWarningMessage, err)
lbc.recorder.Eventf(ing, eventType, eventTitle, "Configuration for %v(Master) was added or updated %s", key, eventWarningMessage)
for _, minion := range mergeableIngExs.Minions {
lbc.recorder.Eventf(ing, eventType, eventTitle, "Configuration for %v/%v(Minion) was added or updated %s: %v", minion.Ingress.Namespace, minion.Ingress.Name, eventWarningMessage, err)
lbc.recorder.Eventf(ing, eventType, eventTitle, "Configuration for %v/%v(Minion) was added or updated %s", minion.Ingress.Namespace, minion.Ingress.Name, eventWarningMessage)
}

if lbc.reportStatusEnabled() {
Expand Down