allowing --with to fill root object

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones 2022-01-04 11:32:05 -07:00
parent 6f4a5a769c
commit c61d47722e
No known key found for this signature in database
GPG Key ID: CFB3A382EB166F4C

View File

@ -38,15 +38,16 @@ func Load(ctx context.Context, withParams []string, args ...string) (*Plan, erro
if len(withParams) > 0 { if len(withParams) > 0 {
for i, param := range withParams { for i, param := range withParams {
log.Ctx(ctx).Debug().Interface("with", param).Msg("applying parameter") log.Ctx(ctx).Debug().Interface("with", param).Msg("compiling parameter")
paramV, err := compiler.Compile(fmt.Sprintf("with%v", i), param) paramV, err := compiler.Compile(fmt.Sprintf("with%v", i), param)
if err != nil { if err != nil {
return nil, err return nil, err
} }
fillErr := v.FillPath(cue.ParsePath("inputs.params"), paramV) log.Ctx(ctx).Debug().Interface("with", param).Msg("filling parameter")
fillErr := v.FillPath(cue.ParsePath(""), paramV)
if fillErr != nil { if fillErr != nil {
return nil, err return nil, fillErr
} }
} }
} }