@@ -29,7 +29,7 @@ type defaultParser struct{}
2929
3030func (d * defaultParser ) Parse (ctx context.Context , originalRawConfig map [string ]interface {}, rawConfig map [string ]interface {}, resolver variable.Resolver , log log.Logger ) (* latest.Config , map [string ]interface {}, error ) {
3131 // delete the commands, since we don't need it in a normal scenario
32- return fillVariablesAndParse (ctx , resolver , rawConfig , log )
32+ return fillVariablesExcludeAndParse (ctx , resolver , rawConfig , log )
3333}
3434
3535func NewCommandsPipelinesParser () Parser {
@@ -45,7 +45,7 @@ func (c *commandsPipelinesParser) Parse(ctx context.Context, originalRawConfig m
4545 return nil , nil , err
4646 }
4747
48- return fillVariablesAndParse (ctx , resolver , preparedConfig , log )
48+ return fillVariablesExcludeAndParse (ctx , resolver , preparedConfig , log )
4949}
5050
5151func NewCommandsParser () Parser {
@@ -61,7 +61,7 @@ func (c *commandsParser) Parse(ctx context.Context, originalRawConfig map[string
6161 return nil , nil , err
6262 }
6363
64- return fillVariablesAndParse (ctx , resolver , preparedConfig , log )
64+ return fillVariablesExcludeAndParse (ctx , resolver , preparedConfig , log )
6565}
6666
6767func NewProfilesParser () Parser {
@@ -106,9 +106,27 @@ func (p *profilesParser) Parse(ctx context.Context, originalRawConfig map[string
106106 return retConfig , rawMap , nil
107107}
108108
109- func fillVariablesAndParse (ctx context.Context , resolver variable.Resolver , preparedConfig map [string ]interface {}, log log.Logger ) (* latest.Config , map [string ]interface {}, error ) {
109+ func NewEagerParser () Parser {
110+ return & eagerParser {}
111+ }
112+
113+ type eagerParser struct {}
114+
115+ func (e * eagerParser ) Parse (ctx context.Context , originalRawConfig map [string ]interface {}, rawConfig map [string ]interface {}, resolver variable.Resolver , log log.Logger ) (* latest.Config , map [string ]interface {}, error ) {
116+ return fillAllVariablesAndParse (ctx , resolver , rawConfig , log )
117+ }
118+
119+ func fillAllVariablesAndParse (ctx context.Context , resolver variable.Resolver , preparedConfig map [string ]interface {}, log log.Logger ) (* latest.Config , map [string ]interface {}, error ) {
120+ return fillVariablesAndParse (ctx , resolver , preparedConfig , log )
121+ }
122+
123+ func fillVariablesExcludeAndParse (ctx context.Context , resolver variable.Resolver , preparedConfig map [string ]interface {}, log log.Logger ) (* latest.Config , map [string ]interface {}, error ) {
124+ return fillVariablesAndParse (ctx , resolver , preparedConfig , log , runtime .Locations ... )
125+ }
126+
127+ func fillVariablesAndParse (ctx context.Context , resolver variable.Resolver , preparedConfig map [string ]interface {}, log log.Logger , excludedPaths ... string ) (* latest.Config , map [string ]interface {}, error ) {
110128 // fill in variables and expressions (leave out
111- preparedConfigInterface , err := resolver .FillVariablesExclude (ctx , preparedConfig , runtime . Locations )
129+ preparedConfigInterface , err := resolver .FillVariablesExclude (ctx , preparedConfig , excludedPaths )
112130 if err != nil {
113131 return nil , nil , err
114132 }
0 commit comments