-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/simplify the config loading logic enabling empty resources (#725)
The method to load the config was utilizing viper which is a common library used alongside cobra CLI tools. However, we were using very little of its functionality and some of its logic was bypassing the intent of our data structures: most clearly, the empty but non-nil resources were still being treated as nil meaning that you would query all resources instead of none of them. Summary: - Sending a config with empty (but not nil) resources will now actually lead to no query being done (other than Sonobuoy gathering its own pod logs at the current time) - Removes viper from the main config handling in order to simplify the logic and clarify the code flow. Uses basic file/json handling to unmarshal the data now. - Continues to load the config from the pwd or default location with an environment override. - Adds a test to ensure `LoadConfig` now properly treats empty values for the Resources. Fixes #721 Signed-off-by: John Schnake <jschnake@vmware.com>
- Loading branch information
1 parent
f2c885d
commit d5c624c
Showing
2 changed files
with
126 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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