From 3ce41fedf157e0f342fabde4d6174fe7a99743ce Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 5 Feb 2022 09:54:38 -0700 Subject: [PATCH] improved handling of p []cue.Selector Signed-off-by: Richard Jones --- plan/task/decodesecret.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plan/task/decodesecret.go b/plan/task/decodesecret.go index 8dbcf633..816661a7 100644 --- a/plan/task/decodesecret.go +++ b/plan/task/decodesecret.go @@ -62,10 +62,10 @@ func (c *decodeSecretTask) Run(ctx context.Context, pctx *plancontext.Context, _ switch entry := i.(type) { case string: secret := pctx.Secrets.New(entry) - path := cue.MakePath(append(p, cue.ParsePath("contents").Selectors()...)...) - pathSelectors := path.Selectors() - logPath := cue.MakePath(pathSelectors[1 : len(pathSelectors)-1]...) + p = append(p, cue.ParsePath("contents").Selectors()...) + logPath := cue.MakePath(p[1 : len(p)-1]...) lg.Debug().Str("path", logPath.String()).Str("type", "string").Msg("found secret") + path := cue.MakePath(p...) output.FillPath(path, secret.MarshalCUE()) case map[string]interface{}: for k, v := range entry {