Skip to content

Commit

Permalink
[chore] Fix deprecation warning for multiline config source calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax committed Jan 21, 2025
1 parent 6fbae90 commit 4782476
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions internal/configsource/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,18 @@ func resolveStringValue(ctx context.Context, configSources map[string]ConfigSour
}
default:
if deprecatedFormUsed {
printDeprecationWarningOnce(fmt.Sprintf(
"[WARNING] Config source expansion formatted as $uri:selector has been deprecated, "+
"use ${uri:selector[?params]} instead. Please replace $%s with ${%s} in your configuration",
expandableContent, expandableContent))
if strings.Contains(expandableContent, "\n") {
printDeprecationWarningOnce(fmt.Sprintf(
"[WARNING] Calling config sources in multiline format is deprecated. "+
"Please convert the following call to the one-line format ${uri:selector?param1"+
"=value1,param2=value2}:\n %s",
expandableContent))
} else {
printDeprecationWarningOnce(fmt.Sprintf(
"[WARNING] Config source expansion formatted as $uri:selector has been deprecated, "+
"use ${uri:selector[?params]} instead. Please replace $%s with ${%s} in your configuration",
expandableContent, expandableContent))
}
}
}
}
Expand Down

0 comments on commit 4782476

Please sign in to comment.