-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config: Remove unused field on config reload (#585)
# Description At config creation with exo cli here is the output: ```Toml [[accounts]] account = 'no longer used name foo' defaultZone = 'ch-gva-2' key = 'EXOxxx' name = 'foo' secret = 'xxx' ``` When you switch account with `exo config` here is the reloaded config account foo: ```Toml [[accounts]] account = 'no longer used name foo' clientTimeout = 20 defaultTemplate = 'Linux Ubuntu 22.04 LTS 64-bit' defaultZone = 'ch-gva-2' environment = 'api' key = 'EXOxxx' name = 'foo' secret = 'xxx' ``` I agree those config fields can be useful to be set by the user if needed but not auto generated on basic configuration profile. Here is what I Updated in the change, by default we create the config: ```Bash ✔ <Configure a new account> [+] API Key [none]: EXOxxx [+] Secret Key [none]: xxx [+] Name [none]: foo ``` No more Account string name is required or asked. Here is the generated config: ```Toml [[accounts]] defaultZone = 'ch-gva-2' key = 'EXOxxx' name = 'foo' secret = 'xxx' ``` When the config reloads, the config remains the same. If an attribute like `defaultTemplate = 'Linux Ubuntu 22.04 LTS 64-bit'` has been set or from the past config it will be kept same for other one like `environment`...etc The benefits of that, config are generated lighter and remain light, user can still personalize it like before...etc. Now, default value (`defaultTemplate`, `timeout`...etc) will be used from code `const` variable, and will be not ingested at config runtime, and will be no more generated at config reload. --------- Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
- Loading branch information
1 parent
ed306e3
commit 2cf4dbc
Showing
8 changed files
with
44 additions
and
43 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
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