commented out replace colons

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones 2022-01-11 13:37:03 -07:00
parent 05820f3a67
commit 63e092c3b1
No known key found for this signature in database
GPG Key ID: CFB3A382EB166F4C

View File

@ -40,8 +40,8 @@ func (c *transformSecretTask) Run(ctx context.Context, pctx *plancontext.Context
diffs := dmp.DiffMain(inputSecretPlaintext, err.Error(), false) diffs := dmp.DiffMain(inputSecretPlaintext, err.Error(), false)
for _, diff := range diffs { for _, diff := range diffs {
if diff.Type == diffmatchpatch.DiffEqual { if diff.Type == diffmatchpatch.DiffEqual {
diffText := strings.ReplaceAll(diff.Text, ":", "") // diffText := strings.ReplaceAll(diff.Text, ":", "") // colons are tricky. Yaml keys end with them but if a secret contained one that got replaced, the secret wouldn't get redacted
errStr = strings.ReplaceAll(errStr, diffText, "<redacted>") errStr = strings.ReplaceAll(errStr, diff.Text, "<redacted>")
} }
} }