From be8bcb92552fa60189b2158ea0c3a71c1b5a4560 Mon Sep 17 00:00:00 2001 From: Kirill Sibirev Date: Tue, 26 Nov 2024 10:43:50 +0100 Subject: [PATCH] Add diff for static config update case (#398) --- pkg/components/config_helper.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/components/config_helper.go b/pkg/components/config_helper.go index d4ad16ab..3ea9e16b 100644 --- a/pkg/components/config_helper.go +++ b/pkg/components/config_helper.go @@ -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 } }