Skip to content

Commit

Permalink
[configuration] Use process templates in JIT by default when using ap…
Browse files Browse the repository at this point in the history
…ricot

OCTRL-925
  • Loading branch information
knopers8 authored and justonedev1 committed Sep 20, 2024
1 parent fad9033 commit cca1fec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configuration/componentcfg/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ type QueryParameters struct {

func NewQueryParameters(parameters string) (p *QueryParameters, err error) {
p = &QueryParameters{
ProcessTemplates: false,
ProcessTemplates: true,
VarStack: make(map[string]string),
}
parameters = strings.TrimSpace(parameters)
Expand Down
8 changes: 7 additions & 1 deletion configuration/template/dplutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ func jitDplGenerate(confSvc ConfigurationService, varStack map[string]string, wo
if err != nil {
return "", fmt.Errorf("JIT could not create a query out of path '%s'. error: %w", consulKey[1], err)
}
// parse parameters if they are present

queryParams := &componentcfg.QueryParameters{ProcessTemplates: false, VarStack: nil}
// Configuration library adds "process=true" if apricot backend is used and "process" is missing,
// thus using apricot backend with no parameters always implies an expectation to process templates.
if strings.HasPrefix(uri, "apricot") {
queryParams.ProcessTemplates = true
}
// parse parameters if they are present
if len(consulKeyTokens) == 2 {
queryParams, err = componentcfg.NewQueryParameters(consulKeyTokens[1])
if err != nil {
Expand Down

0 comments on commit cca1fec

Please sign in to comment.