| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Signed-off-by: Olblak <me@olblak.com>
There was a problem hiding this comment.
This PR fixes a nil-pointer panic in the Kubernetes autodiscovery crawler introduced when support for multi-document YAML was added, by ensuring empty YAML documents don’t produce nil decoded structs and by safely skipping any nil entries during discovery.
Changes:
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file| File | Description |
|---|---|
| pkg/plugins/autodiscovery/kubernetes/utils.go | Avoids inserting nil decoded YAML documents into the returned map. |
| pkg/plugins/autodiscovery/kubernetes/utils_test.go | Updates file-search expectations to include new empty YAML fixtures. |
| pkg/plugins/autodiscovery/kubernetes/testdata/empty/kubernetes.1.yaml | Adds an empty YAML fixture file (0 bytes) for regression coverage. |
| pkg/plugins/autodiscovery/kubernetes/testdata/empty/kubernetes.2.yaml | Adds an “empty document” YAML fixture (---) for regression coverage. |
| pkg/plugins/autodiscovery/kubernetes/prow.go | Skips nil document entries during Prow manifest discovery to prevent panics. |
| pkg/plugins/autodiscovery/kubernetes/main.go | Adjusts handling/logging when no working directory is defined. |
| pkg/plugins/autodiscovery/kubernetes/main_test.go | Adds a “no manifest” test case and removes the hard failure on zero pipelines. |
| pkg/plugins/autodiscovery/kubernetes/kubernetes.go | Skips nil document entries during Kubernetes manifest discovery to prevent panics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fix #8915
In version v0.115.0 we introduced the ability to update multiple YAML document but I didn't handle well test case where an empty yaml was loaded which would result to its data to be set to nil. I fix the problem and added a test case
Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement