You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And used the "Read from file" button on the UI when creating a new MachineRegistration. Despite the schema being invalid, the UI did not error out and still proceeded creating the registration with an empty config.
Would it be possible to validate the schema and error out instead?
In this case it would fail as MachineRegistration.spec.config.users does not exist.
The text was updated successfully, but these errors were encountered:
anmazzotti
changed the title
Missing schema validation when loading registration config from file.
Missing schema validation when loading registration config from file
Oct 17, 2024
@anmazzotti we don't do schema validation in UI, generally, afaik. It's a task usually handled by the backend. Probably the general Rancher backend has already a module/code to handle this, that the elemental-operator could re-use.
The schema is already invalid backend side and will fail to apply, but the "Read from file" UI button seems to behave differently, leading to an empty config instead of erroring out when creating the MachineRegistration.
But the "read from file" is a purely frontend action to get the contents of the file and transform it to YAML. If the content is not "transformable" I imagine that the lib used https://github.com/nodeca/js-yaml will throw some error.
This is related to: rancher/elemental-operator#869
I created this (incorrect) config file:
And used the "Read from file" button on the UI when creating a new MachineRegistration. Despite the schema being invalid, the UI did not error out and still proceeded creating the registration with an empty config.
Would it be possible to validate the schema and error out instead?
In this case it would fail as
MachineRegistration.spec.config.users
does not exist.The text was updated successfully, but these errors were encountered: