Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pliurh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
…uctures Also introduces assert package in the test code for easier diagnosis of unit test failures.
Move data structures and related functions into their own files.
This change streamlines the reading and validation functions so that it is easier to get a Config instance with the defaults or with valid values read from a file. A new convenience function for loading the active configuration, ignoring a missing configuration file, is added. The k8s YAML parser is used to read the config file, instead of the default parser, to ensure support for `json:"-"` directives to ignore fields in the input. The unit tests are updated to parse input config instead of using a data structure. This more accurately simulates what happens when the real program reads the config if only part of the file is populated, and clarifies which part of the config each test scenario is checking. It also allows for more, smaller, scenarios to isolate configuration validation and defaulting failures. The validation for node name changing is only relevant when starting the server, so that is moved to the run command implementation to make the unit tests for config easier to understand. The show-config command implementation no longer needs to map between multiple configuration data structures, so streamline that code.
|
@pliurh: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Which issue(s) this PR addresses:
Closes #