moved secret.MarshalCUE to outside of Walk
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
parent
3292771811
commit
a3c9c008c2
@ -49,8 +49,8 @@ func (c *transformSecretTask) Run(ctx context.Context, pctx *plancontext.Context
|
|||||||
}
|
}
|
||||||
|
|
||||||
type pathSecret struct {
|
type pathSecret struct {
|
||||||
path cue.Path
|
path cue.Path
|
||||||
value *compiler.Value
|
secret *plancontext.Secret
|
||||||
}
|
}
|
||||||
|
|
||||||
var pathsSecrets []pathSecret
|
var pathsSecrets []pathSecret
|
||||||
@ -66,14 +66,14 @@ func (c *transformSecretTask) Run(ctx context.Context, pctx *plancontext.Context
|
|||||||
newLeafSelectors := v.Path().Selectors()[len(functionPathSelectors):]
|
newLeafSelectors := v.Path().Selectors()[len(functionPathSelectors):]
|
||||||
newLeafSelectors = append(newLeafSelectors, cue.Str("contents"))
|
newLeafSelectors = append(newLeafSelectors, cue.Str("contents"))
|
||||||
newLeafPath := cue.MakePath(newLeafSelectors...)
|
newLeafPath := cue.MakePath(newLeafSelectors...)
|
||||||
pathsSecrets = append(pathsSecrets, pathSecret{newLeafPath, secret.MarshalCUE()})
|
pathsSecrets = append(pathsSecrets, pathSecret{newLeafPath, secret})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
output := compiler.NewValue()
|
output := compiler.NewValue()
|
||||||
|
|
||||||
for _, ps := range pathsSecrets {
|
for _, ps := range pathsSecrets {
|
||||||
output.FillPath(ps.path, ps.value)
|
output.FillPath(ps.path, ps.secret.MarshalCUE())
|
||||||
}
|
}
|
||||||
|
|
||||||
return output, nil
|
return output, nil
|
||||||
|
Reference in New Issue
Block a user