-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor configuration loading, eliminating the hard to follow `ClientConfigLoadingRules`. The Runtime config has been converted into a "first class citizen" by making a dedicated struct for it. It now stores not only the config, but also the "k0svars". This allows commands like `token create` or `k0s status` to reuse all the parameters of the controller, such as `--data-dir` and `--status-socket` without the user having to supply them again. The runtime config also stores a pid, which is used to roughly check if the file belongs to an active process or if it's a leftover from a previous crash. The pid mechanism also prevents two k0s controllers from running in the same directory. The `k0svars`, aka `constant.CfgVars` has been moved to `config.CfgVars` as it is not a constant to begin with. The `k0sVars` now duplicates most of the `config.CLIOptions`, this is to reduce the number of arguments that need to be passed around, as the essentials are available from `k0svars`, which was passed around to almost everywhere already. The `config.GetCmdOptions()` now takes the `*cobra.Command` as an argument and can return an error. The cobra command is used to build the "k0svars" by looking at flag values. Signed-off-by: Kimmo Lehto <klehto@mirantis.com> Co-authored-by: Tom Wieczorek <twz123@users.noreply.github.com> Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
- Loading branch information
Showing
91 changed files
with
1,493 additions
and
1,292 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
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
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
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
Oops, something went wrong.