Skip to content

Commit

Permalink
Add diff for static config update case
Browse files Browse the repository at this point in the history
  • Loading branch information
l0kix2 committed Nov 26, 2024
1 parent f02c865 commit b3e7432
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/components/config_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,16 @@ func (h *ConfigHelper) NeedReload() (bool, error) {
}
curConfig := h.getCurrentConfigValue(fileName)
if !cmp.Equal(curConfig, newConfig) {
h.apiProxy.RecordNormal(
"Reconciliation",
fmt.Sprintf("Config %s needs reload", fileName))
if curConfig == nil {
h.apiProxy.RecordNormal(
"Reconciliation",
fmt.Sprintf("Config %s needs creation", fileName))
} else {
configsDiff := cmp.Diff(string(curConfig), string(newConfig))
h.apiProxy.RecordNormal(
"Reconciliation",
fmt.Sprintf("Config %s needs reload. Diff: %s", fileName, configsDiff))
}
return true, nil
}
}
Expand Down

0 comments on commit b3e7432

Please sign in to comment.