Skip to content

Commit

Permalink
adjust namespaced lua script name
Browse files Browse the repository at this point in the history
Signed-off-by: juicer <[email protected]>
  • Loading branch information
cw-Guo committed Sep 14, 2024
1 parent 6c926d2 commit 47ac1d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func (cfg ClusterFluentBitConfig) RenderNamespacedLuaScript(
if err != nil {
return nil, err
}
namespacedScriptName := fmt.Sprintf("%s-%x", p.Lua.Script.Key, md5.Sum([]byte(f.ObjectMeta.Namespace)))
namespacedScriptName := fmt.Sprintf("%x-%s", md5.Sum([]byte(f.ObjectMeta.Namespace)), p.Lua.Script.Key)
scripts = append(scripts, Script{Name: namespacedScriptName, Content: script})
}
}
Expand Down
2 changes: 1 addition & 1 deletion apis/fluentbit/v1alpha2/plugins/filter/lua_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ func (l *Lua) Params(_ plugins.SecretLoader) (*params.KVs, error) {
}

func (l *Lua) MakeNamespaced(ns string) {
l.Script.Key = fmt.Sprintf("%s-%x", l.Script.Key, md5.Sum([]byte(ns)))
l.Script.Key = fmt.Sprintf("%x-%s", md5.Sum([]byte(ns)), l.Script.Key)
}

0 comments on commit 47ac1d3

Please sign in to comment.