fix: Fix a bug in template processor occurred when mixing default and non-default namespaces in one config (#3652)

This commit is contained in:
Kent Dong
2026-03-27 20:02:22 +08:00
committed by GitHub
parent 231ba1cd23
commit 983c57f404
2 changed files with 61 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ func (p *TemplateProcessor) ProcessConfig(cfg *config.Config) error {
configStr := string(jsonBytes)
// Find all value references in format:
// ${type.name.key} or ${type.namespace/name.key}
valueRegex := regexp.MustCompile(`\$\{([^.}]+)\.(?:([^/]+)/)?([^.}]+)\.([^}]+)\}`)
valueRegex := regexp.MustCompile(`\$\{([^.}/]+)\.(?:([^/}]+)/)?([^.}/]+)\.([^}]+)\}`)
matches := valueRegex.FindAllStringSubmatch(configStr, -1)
// If there are no value references, return immediately
if len(matches) == 0 {