Skip to content

fix(file): don't output binary file content#7874

Merged
olblak merged 8 commits intoupdatecli:mainfrom
AdeshDeshmukh:fix/3636-dont-output-binary
Mar 22, 2026
Merged

fix(file): don't output binary file content#7874
olblak merged 8 commits intoupdatecli:mainfrom
AdeshDeshmukh:fix/3636-dont-output-binary

Conversation

@AdeshDeshmukh
Copy link
Copy Markdown
Contributor

  • Add isBinaryContent() to detect binary files by null bytes

  • Add truncateBinaryContent() to show friendly message

  • Update target.go to check content before logging diffs

  • Update condition.go to check content before logging diffs

  • Add comprehensive unit tests for binary detection

When file resources process binary files (e.g., .cnb containers, executables), the output is now truncated to '[binary content, X bytes]' instead of dumping raw binary data to the console.

Fixes #3636

Fix #XXX

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request resource-file Resource of kind File ux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: don't output binary (file-source)

3 participants