Skip to content

Commit cca1fec

Browse files
knopers8justonedev1
authored andcommitted
[configuration] Use process templates in JIT by default when using apricot
OCTRL-925
1 parent fad9033 commit cca1fec

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

configuration/componentcfg/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ type QueryParameters struct {
175175

176176
func NewQueryParameters(parameters string) (p *QueryParameters, err error) {
177177
p = &QueryParameters{
178-
ProcessTemplates: false,
178+
ProcessTemplates: true,
179179
VarStack: make(map[string]string),
180180
}
181181
parameters = strings.TrimSpace(parameters)

configuration/template/dplutil.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,14 @@ func jitDplGenerate(confSvc ConfigurationService, varStack map[string]string, wo
8888
if err != nil {
8989
return "", fmt.Errorf("JIT could not create a query out of path '%s'. error: %w", consulKey[1], err)
9090
}
91-
// parse parameters if they are present
91+
9292
queryParams := &componentcfg.QueryParameters{ProcessTemplates: false, VarStack: nil}
93+
// Configuration library adds "process=true" if apricot backend is used and "process" is missing,
94+
// thus using apricot backend with no parameters always implies an expectation to process templates.
95+
if strings.HasPrefix(uri, "apricot") {
96+
queryParams.ProcessTemplates = true
97+
}
98+
// parse parameters if they are present
9399
if len(consulKeyTokens) == 2 {
94100
queryParams, err = componentcfg.NewQueryParameters(consulKeyTokens[1])
95101
if err != nil {

0 commit comments

Comments
 (0)