-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the registry reader #4153
Comments
This should not be done (see #4148 (comment))! We should only fail on incorrect types. In which case RD should refuse to start. |
There's also the corner case of if the user supplies a |
This should be a fatal error. I think supplying a DWORD for just a plain I expect the same things to be an error in the other formats too, e.g. { "experimental": 42 } should fail because We also need to make sure the settings pass the validator; if they don't, we should also refuse to start. |
Tested on windows 11 providing settings with incorrect registry types. Rancher Desktop is just ignoring the deployment profiles and showing the first-run dialog. It is NOT throwing a fatal error. Reg file used:
Note that the values with incorrect reg types are:
|
A list of TODO items (from code review on #4148)
[x] Separate walking the subkeys from walking the values
[x ] Remove the comment 'Alternatively, if the keys work, we could break, even if both hives are empty....'
[x ] Give
readRegistryUsingSchema
a consistent return typeRecursivePartial<settings.Settings>|null
[x] Report unrecognized registry keys and values
[x] Clarify array processing, like do that before walking sub-objects
[x] See if I can remove the cast
multiSzValue as nativeReg.Value
nativeReg.queryValueRaw
to get a(type, value)
pair of the registry value, and then casing on the type field to parse out the correct kind of value.[x] line 167: Is
regValue
ever not an object? - This code has changed too much to point to what this comment was referring to, or determine if it's still valid.[x] Pass in the current registry path so we can report the full path in error-messages, not just the current key
[x] More type-checking is needed when reading in registry values, e.g. when reading a string into a number, etc.
The text was updated successfully, but these errors were encountered: