0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-14 17:48:37 +00:00

fix(go.d dyncfg): don't overwrite source ()

This commit is contained in:
Ilya Mashchenko 2025-02-18 21:33:12 +02:00 committed by GitHub
parent 231813871a
commit 943bfe5286
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 10 deletions
src/go/plugin/go.d/agent/jobmgr

View file

@ -674,12 +674,8 @@ func (m *Manager) dyncfgConfigUpdate(fn functions.Function) {
}
func (m *Manager) dyncfgSetConfigMeta(cfg confgroup.Config, module, name string, fn functions.Function) {
src := fmt.Sprintf("type=dyncfg,module=%s,job=%s", module, name)
if v := getFnSourceValue(fn, "user"); v != "" {
src += fmt.Sprintf(", user=%s", v)
}
cfg.SetProvider("dyncfg")
cfg.SetSource(src)
cfg.SetSource(fn.Source)
cfg.SetSourceType("dyncfg")
cfg.SetModule(module)
cfg.SetName(name)

View file

@ -311,11 +311,7 @@ func (m *Manager) verifyVnodeUnique(newCfg *vnodes.VirtualNode) error {
func dyncfgUpdateVnodeConfig(cfg *vnodes.VirtualNode, name string, fn functions.Function) {
cfg.SourceType = confgroup.TypeDyncfg
src := "type=dyncfg"
if v := getFnSourceValue(fn, "user"); v != "" {
src += fmt.Sprintf(", user=%s", v)
}
cfg.Source = src
cfg.Source = fn.Source
cfg.Name = name
if cfg.Hostname == "" {
cfg.Hostname = name