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
{{ message }}
Repository navigation
MC* should use Ignition's validation logic to validate Ignition types #479
MCO/MCD can currently use MCs that contain Ignition types that are invalid according to Ignition. It should check that the configs are valid using Ignition's validation logic.
Steps to reproduce the issue:
Create a machine config that should be invalid (e.g. use a relative path for a file)
Have that work instead of failing
Describe the results you received:
MCD applied the change
Describe the results you expected:
MCO/D/something should fail when presented with an invalid config
cc @kikisdeliveryservice since I was talking about this with her
cc @abhinavdahiya since he had some ideas on using admission plugins for this
I can confirm through testing on my cluster that I am able to create and apply a machineconfig with what should be invalid ignition config fields.
For example, I am able to write a file to a relative path home/user and a mc is generated and applied successfully without error via the MCD:
We are simply applying the machineconfigs without ignition validation, just checking whether or not the section is supported or not by mcd (though ssh goes thru a few more checks).
Ideally whatever is generating it should fail instead of whatever is consuming it. Invalid MCs should probably be disallowed everywhere if that's possible.
Literally after parsing you should be able to call config.ValidateWithoutSource(reflect.ValueOf(mcObject)) wherever its being generated. It's using reflection and will walk structs/slices so you can even call it on the top level MC instead of the Ignition bits. Hell, you can even define your own Validation functions on the other bits of the MCs if you want.
just noticed that we're not setting the ignition version to:
SSH MCs (00-*-ssh)
registries MCs (99-*-registries)
we should be doing that afaict.
That's because the above are not generated from templates in /templates and do not call "ign.Convert` which is setting the correct version. We should be doing something similar to avoid 1) setting version strings manually 2) always ensure ignition drives the versioning (right now we create tmp ignition configs from the above w/o validation at all)
Activity
kikisdeliveryservice commentedon Feb 22, 2019
I can confirm through testing on my cluster that I am able to create and apply a machineconfig with what should be invalid ignition config fields.
For example, I am able to write a file to a relative path
home/userand a mc is generated and applied successfully without error via the MCD:We are simply applying the machineconfigs without ignition validation, just checking whether or not the section is supported or not by mcd (though ssh goes thru a few more checks).
runcom commentedon Feb 22, 2019
I would add that we don't need to Degrade in such a case, just (sort of) rejecting the MC if possible
ajeddeloh commentedon Feb 22, 2019
Ideally whatever is generating it should fail instead of whatever is consuming it. Invalid MCs should probably be disallowed everywhere if that's possible.
Literally after parsing you should be able to call
config.ValidateWithoutSource(reflect.ValueOf(mcObject))wherever its being generated. It's using reflection and will walk structs/slices so you can even call it on the top level MC instead of the Ignition bits. Hell, you can even define your own Validation functions on the other bits of the MCs if you want.kikisdeliveryservice commentedon Feb 22, 2019
/assign
kikisdeliveryservice commentedon Feb 22, 2019
as per convo with @runcom We'll have to go Degraded on bad MCs for now and then iterate once the Unreconcilable epic is done switch to that.
kikisdeliveryservice commentedon Feb 23, 2019
Started on this, will pick it up on Monday.
runcom commentedon Feb 24, 2019
just noticed that we're not setting the ignition version to:
we should be doing that afaict.
That's because the above are not generated from templates in
/templatesand do not call "ign.Convert` which is setting the correct version. We should be doing something similar to avoid 1) setting version strings manually 2) always ensure ignition drives the versioning (right now we create tmp ignition configs from the above w/o validation at all)add ign validation check to reconcilable()