Repository navigation
Conversation
With --find-renames, contentSearch redacted (or decoded) each removed and added Secret in place to score it as a rename candidate. doDiff then redacted the reported pair a second time, and a redacted secret does not parse as a secret any more: its data values are no longer base64. A renamed Secret, and a removed or added one that was scored as a candidate, was printed as Error parsing old secret: error unmarshaling JSON: ... illegal base64 data at input byte 0 instead of the redacted manifest. Score the candidates on copies, so that doDiff transforms each secret once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
--find-renames, a Secret that is renamed, or removed and added in the same diff, is printed as a parse error instead of the redacted manifest.saandsbare two copies of a one-template chart;sbrenames the Secretapp-credstoapp-creds-v2and changes one value:When the pair is scored but not taken as a rename (e.g.
--find-renames 0.01), the removal and the addition each show the same error line.contentSearchredacts (or decodes) each candidate pair in place to score it, anddoDiffthen redacts the reported resources a second time. The redacted values ('-------- # (7 bytes)') are not base64, so the second pass cannot parse the secret.--show-secretsis not affected.Fix
Score the candidates on copies of the two
MappingResults, so thatdoDiffis the only place that redacts or decodes a reported secret. The same command now prints:Tests
TestRenameDetectionWithRedactedSecretscovers a detected and a rejected rename of a Secret with the default redaction. Both cases fail on master with the error above.go test ./diff/andmake lintpass.