From 3b07de369322a0ad14f4b3366581aca7011f4e15 Mon Sep 17 00:00:00 2001 From: Maximilian Blatt Date: Tue, 6 Feb 2024 09:25:29 +0100 Subject: [PATCH] fix(fluentd): Use custom plugin content for hash generation Signed-off-by: Maximilian Blatt --- apis/fluentd/v1alpha1/plugins/params/model.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apis/fluentd/v1alpha1/plugins/params/model.go b/apis/fluentd/v1alpha1/plugins/params/model.go index f63b92044..a30390249 100644 --- a/apis/fluentd/v1alpha1/plugins/params/model.go +++ b/apis/fluentd/v1alpha1/plugins/params/model.go @@ -72,6 +72,13 @@ func (ps *PluginStore) Hash() string { c.Store[k] = v } + // Custom plugins don't have stored properties but only contain the config + // as plain text. + // Set the content here to avoid generating the same hash code for all + // custom plugins resulting in only one custom plugin being ever set for + // one config. + c.Content = ps.Content + c.InsertChilds(ps.Childs...) return utils.HashCode(c.String()) }