crc
crc copied to clipboard
[Idea] Switching preset should store configuration option in a preset-specific file
At the moment, we store our configuration in crc.json
, which is unaware of preset specific changes. It stores all the values (eg. 16G of memory) in a single file, and when moved from OpenShift to Microshift, this might mean we assign a lot more memory to this instance as it assign 16G that was given for OpenShift.
We could keep crc.json
to store the general configuration, but a specific file for preset-based values, such as memory
, cpus
, disksize
and bundle
. This can be stored as crc-[preset].json
(eg. crc-microshift.json
) and when switched we therefore preserve these specific configuration options.
crc.json
{
"preset": "openshift",
"proxy": ...
}
crc-openshift.json
{
"cpus": 8,
"memory": "16G"
// no disk-size => implies the default value
}
crc-microshift.json
{
"memory": "4G",
//cpus not set => implies default of 2
}
This should be considered as a spike as this is not proven to be a solution yet.
An alternative could be single file with an array of preset-specific values:
{
"preset": "openshift",
"vm-config": [
"microshift": {
"memory": "6"
},
"openshift": {
"disk-size": "..."
},
]
}
With viper separate preset files taking precedence over the main one might be easier to implement though.
changing to read a file by name sounds easier than adding logic to handle the array. you would like this eventually to be 'exchangeable' maybe?