fix: Do not fail analysis if node list does not exist #1678
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.
Description, Motivation and Context
When collection files from support bundles, we should not fail if
node_list.json
is not found. This file contains the list of nodes host bundles were collected from, not file content needing analysing.Using the spec below, here are test results
Before
sudo preflight -v=2 --interactive=false spec.yaml I1107 19:42:58.056605 93460 loader.go:261] Loaded 1 troubleshoot specs successfully I1107 19:42:58.056826 93460 run.go:102] Preflight data collected in temporary directory: /tmp/preflightbundle-3189511120 [Certificate Key Pair] Running collector... --- FAIL: Certificate Key Pair --- Analyzer Failed: analyze: failed to get node list: host-collectors/system/node_list.json: not found --- FAIL certificate FAILED Saving preflight bundle to preflightbundle-2024-11-07T19_42_58.tar.gz
After
Checklist
Does this PR introduce a breaking change?