secretfile: data -> plaintext
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
a25e6bb3a2
commit
6aa4f6b8b3
@ -31,12 +31,12 @@ func (c secretFileTask) Run(ctx context.Context, pctx *plancontext.Context, _ so
|
|||||||
|
|
||||||
lg.Debug().Str("path", secretFile.Path).Msg("loading secret")
|
lg.Debug().Str("path", secretFile.Path).Msg("loading secret")
|
||||||
|
|
||||||
data, err := os.ReadFile(secretFile.Path)
|
plaintext, err := os.ReadFile(secretFile.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
secret := pctx.Secrets.New(string(data))
|
secret := pctx.Secrets.New(string(plaintext))
|
||||||
out := compiler.NewValue()
|
out := compiler.NewValue()
|
||||||
if err := out.FillPath(cue.ParsePath("contents"), secret.Value()); err != nil {
|
if err := out.FillPath(cue.ParsePath("contents"), secret.Value()); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user