Skip to content

Commit

Permalink
Pipeline: file/path in 'import' op should be templatable by default
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Kosegi <richard.kosegi@gmail.com>
  • Loading branch information
rkosegi committed Aug 15, 2024
1 parent 5baea07 commit 51c4581
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pipeline/import_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ func (ia *ImportOp) String() string {
}

func (ia *ImportOp) Do(ctx ActionContext) error {
val, err := parseFile(ia.File, ia.Mode)
val, err := parseFile(ctx.TemplateEngine().RenderLenient(ia.File, ctx.Snapshot()), ia.Mode)
if err != nil {
return err
}
if len(ia.Path) > 0 {
ctx.Data().AddValueAt(ia.Path, val)
p := ctx.TemplateEngine().RenderLenient(ia.Path, ctx.Snapshot())
if len(p) > 0 {
ctx.Data().AddValueAt(p, val)
} else {
if !val.IsContainer() {
return ErrNotContainer
Expand Down

0 comments on commit 51c4581

Please sign in to comment.