USHIFT-936, USHIFT-942: reconcile the internal and external config data structures#1442
Conversation
|
@dhellmann: This pull request references USHIFT-936 which is a valid jira issue. DetailsIn response to this:
Instructions 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. |
|
@dhellmann: This pull request references USHIFT-936 which is a valid jira issue. DetailsIn response to this:
Instructions 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. |
|
Tests failing with |
ffbe3d5 to
dbc63b4
Compare
|
@dhellmann: This pull request references USHIFT-936 which is a valid jira issue. DetailsIn response to this:
Instructions 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. |
|
@dhellmann: This pull request references USHIFT-936 which is a valid jira issue. DetailsIn response to this:
Instructions 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. |
|
/retest |
af6f0d1 to
b6e7c83
Compare
b995020 to
d82f739
Compare
d82f739 to
bed0b88
Compare
bed0b88 to
b9d1ecf
Compare
|
@dhellmann: This pull request references USHIFT-936 which is a valid jira issue. DetailsIn response to this:
Instructions 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. |
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.
7b0f04e to
edf801f
Compare
Track the values we read from the user-provided configuration file separately from those that are defaulted or computed from other settings. This allows us to apply rules to computed values, like ApiServer.SkipAddress, based on whether or not the user has overridden the default.
Use clearer names based on what they return.
We need to convert the hostname to a value suitable for use as a node name. Instead of doing that in many places, provide a method to return the modified value.
We always want to defragment on startup, so we do not need a flag.
The URL field is not user-configurable, so we don't need a function to parse it.
edf801f to
b0d3371
Compare
|
/hold cancel I believe this is ready for review. |
|
/test e2e-rpm-install |
|
@dhellmann: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
DetailsIn response to this:
Instructions 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. |
|
LGTM, I was able to pull this and run it with out any issues. |
|
@dhellmann: This pull request references USHIFT-942 which is a valid jira issue. DetailsIn response to this:
Instructions 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. |
| // Returns the default user config file if that exists, else the default global | ||
| // config file, else the empty string. | ||
| func findConfigFile() string { | ||
| userConfigFile, _ := homedir.Expand(DefaultUserConfigFile) |
There was a problem hiding this comment.
It just occurred to me that we wanted to remove user dir (microshift needs to be run as root anyway), but given the size of the PR and effort spent on reviewing it we might do it in another PR :)
Especially what you're doing here is just moving what already existed
|
@eggfoobar gave +1. Also saw @copejon +1 on slack |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhellmann, pacevedom, pmtk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@dhellmann: The following test 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. |
This PR eliminates some technical debt by merging the internal and
external representation of our configuration. The PR is structured with
several commits that should each work independently to make reviewing
the large number of changes simpler.
/assign @pmtk
/assign @pacevedom
/assign @copejon