Skip to content

Ignition version validation with Kargs|FIPS #888

Closed

Description

@runcom

Playing around with kargs and fips, it's not possible to just create an MC like this:

apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: worker
  name: 50-kargs
spec:
  kargs:
    - nosmt

We should allow such a MC w/o incurring into ignition versions errors. It's not trivial though cause the ignition config is not a pointer so we can't really differentiate.

    Reason:                Failed to render configuration for pool worker: machine config: 50-kargs contains invalid ignition config: error: invalid config version (couldn't parse)

Activity

  1. cgwalters commented on Jun 25, 2019

    @cgwalters
    Member

    We can detect if an Ignition spec is empty, and make that silently OK.

    That said this is also potentially an argument to backtrack on extending MachineConfig as is and instead introducing some other CRD operatingsystemconfig or whatever.

  2. runcom commented on Jun 25, 2019

    @runcom
    MemberAuthor

    We can detect if an Ignition spec is empty, and make that silently OK.

    yes, but that requires looking at fields for the Ingnition Config struct cause it's not a pointer though

  3. cgwalters commented on Jun 25, 2019

    @cgwalters
    Member

    yes, but that requires looking at fields for the Ingnition Config struct

    We already walk the struct to e.g. verify that it doesn't have a non-empty storage section etc.

  4. runcom commented on Jun 25, 2019

    @runcom
    MemberAuthor

    We already walk the struct to e.g. verify that it doesn't have a non-empty storage section etc.

    yeah, to be clear, I'm not against doing that 😄 I just wished we had a pointer to straight compare to nil and get done with it 😃

  5. ericavonb commented on Jun 25, 2019

    @ericavonb

    I ran into this issue my first time playing around with machineconfigs 😄 . As annoying as the check for nil everywhere is, I'm in favor of the pointer for this one.

    Should this we discussed in the openshift/api PR somewhere?

  6. runcom commented on Jun 25, 2019

    @runcom
    MemberAuthor

    Should this we discussed in the openshift/api PR somewhere?

    as a follow up to that I guess yeah. If that PR makes 4.2, we need a transition plan for 4.3 to account for this change but I won't risk changing this for 4.2 (as annoying as it is I concur 😄 )

  7. kikisdeliveryservice commented on Jun 25, 2019

    @kikisdeliveryservice
    Contributor

    The ignition verification specifically requires a version for a MC to be valid. That's kind of baked in and not specific to Kargs/FIPs in the MCO.

  8. kikisdeliveryservice commented on Jun 25, 2019

    @kikisdeliveryservice
    Contributor

    One way to get around this is for all MCs that are just kargs/FIPs && if an ign config is completely empty, just call NewIgnConfig() and add that to the MC ign section:

    func NewIgnConfig() igntypes.Config {

    This shouldn't be bad to implement. Since I worked on the ignition stuff and the reconcilable stuff, I'm happy to pick this up.

  9. kikisdeliveryservice commented on Jun 26, 2019

    @kikisdeliveryservice
    Contributor

    We can detect if an Ignition spec is empty, and make that silently OK.

    That said this is also potentially an argument to backtrack on extending MachineConfig as is and instead introducing some other CRD operatingsystemconfig or whatever.

    I would also add that while I think checking whether or not an Ignition config is reconcilable is a good idea, I think that erroring out on the version is not helpful esp if we are trying to put a little space between/not tightly couple the concept of a machineconfig and an ignconfig (ie we use ign as a tool but present this to the user as solely an ign config). All we'd have to do is always add maxVersion of ign to the ign.version section (NewIgnConfig) of the rendered config and check the error from validation to make sure that the ignition version missing is the only error.

    ( added this verification so I can add the extra ignition version skipping too)

  10. kikisdeliveryservice commented on Jun 26, 2019

    @kikisdeliveryservice
    Contributor

    /assign

  11. added a commit that references this issue on May 15, 2026
    80f7838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions