* fix(cluster-resources): stop emitting duplicate unredacted YAML copy
storeCustomResource was writing both a JSON and a YAML file for every
custom resource. The built-in redactors are authored for JSON, so the
YAML copy was left unredacted. JSON is valid YAML, so analyzers that
expect YAML can still parse the JSON file.
Also convert the built-in kurl installer redactors from YAML-specific
paths to scoped JSON regex redactors so they continue to apply after the
YAML copy is removed.
* fix(cluster-resources): add YAML symlinks and cover cluster-scoped kurl installer
- Add a .yaml symlink for every custom-resource JSON file so existing
analyzers that look for the old YAML copy keep working. The symlink
points at the JSON file, so redaction of the JSON also redacts the YAML
view.
- Fix the built-in kurl installer redactor to match both the cluster-scoped
file (installers.cluster.kurl.sh.json) and the namespaced file pattern
(installers.cluster.kurl.sh/*.json). The previous selector only matched
the namespaced form.
---------
Co-authored-by: ElasticClaw Factory <factory@replicated.com>
* fix: prevent redactors from corrupting binary files (#102)
Redactors were adding newlines to files without them, corrupting binary
files during support bundle collection (51 bytes → 53 bytes).
Created LineReader to track original newline state and only restore
newlines when they were present in the original file.
- Added pkg/redact/line_reader.go
- Refactored single_line.go, multi_line.go, literal.go
- Added 48 tests, all passing
- Verified: binary files now preserved byte-for-byte
Fixes#102
* fix: handle empty lines correctly in MultiLineRedactor
- Check line1 == nil instead of len(line1) == 0 for empty file detection
- Fixes edge case where file containing only '\n' would be dropped
- Addresses bugbot finding about empty line handling
* fix: handle empty lines correctly in MultiLineRedactor
- Check line1 != nil instead of len(line1) > 0 in both locations
- Fixes edge case where empty trailing lines would be dropped
- Fix test isolation in literal_test.go (move ResetRedactionList to parent)
- Addresses bugbot findings about empty line handling
* fmt
* chore: update regression baselines from run 20107431959
* adding defense
* fix: propagate non-EOF errors in all early return paths
Ensure non-EOF errors (like buffer overflow) are properly propagated
to caller in both pre-loop early returns. Addresses bugbot finding.
* fix: use unique test names to prevent redaction list pollution
Use t.Name() instead of hardcoded 'test' to ensure each test
has unique redactor name, preventing parallel test interference
---------
Co-authored-by: hedge-sparrow <sparrow@spooky.academy>
This change removes the IPv4 address redaction which previously ran by default on all
support bundle collections.
Folks that want to redact IPv4 addresses will need to add that redactor manually to their redactor specs.
add redact type, and begin wiring global redactors
use per-collector redactors
add a test of the 'data' collector and redaction
handle literal string replacements
remove redundant types and redact calls
add proper redactor type, foundations of global redactors
accept global redactors from the CLI, include sample redaction spec