Skip to content
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

Validate merged/replaced Ignition configs if they're local/inline #275

Open
bgilbert opened this issue Aug 17, 2021 · 2 comments · May be fixed by #476
Open

Validate merged/replaced Ignition configs if they're local/inline #275

bgilbert opened this issue Aug 17, 2021 · 2 comments · May be fixed by #476
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers jira validation Issue related to config validation

Comments

@bgilbert
Copy link
Contributor

When merging/replacing a local or inline config, we already have the config contents, so we should run it through Ignition config validation to catch problems early. (For example, the user may have provided a Butane config by mistake.)

@bfallik
Copy link

bfallik commented Dec 8, 2021

FWIW I believe I hit this exact problem recently with a snippet like:

variant: fcos
version: 1.4.0
ignition:
  config:
    merge:
    - local: fcos/nano.bu
      ...

I found an example elsewhere online that made me realize merged configs are meant to contain ignition and not butane.

It would be very helpful if examples.md illustrated this merge+local scenario.

@prestist prestist added the validation Issue related to config validation label Jan 10, 2023
@bgilbert bgilbert added the good first issue Good for newcomers label Jun 13, 2023
@Adam0Brien Adam0Brien self-assigned this Jul 3, 2023
@bgilbert
Copy link
Contributor Author

bgilbert commented Jul 4, 2023

There's a complication: it's valid to embed an Ignition config with a version newer than the ones Butane knows about. We should probably not reject such configs. To handle that, I think it makes sense to catch ErrUnknownVersion from parse, and warn that the config version is unknown and validation has been skipped. In that case we're still confirming that the JSON is valid and that we appear to have an Ignition config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers jira validation Issue related to config validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants