Unknown config field only yields warning, continues boot
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 974
- Forks
- 296
- Avg merge
- 6d 14h
- Merged PRs (30d)
- 9
Description
Bug
If I put in a key in my ignition config that is unused should my system continue to boot? In my example I was handcrafting an ignition config (shame on me) based on ignition snippets provided by another user and I placed the filsystems key at the toplevel and not under the storage key. My system booted, but my filesystems weren't set up as I would expect.
The ignition config used:
{
"ignition": {
"version": "3.0.0"
},
"systemd": {
"units": [
{
"name": "example.service",
"enabled": true,
"contents": "[Service]\nType=oneshot\nExecStart=/usr/bin/false\n\n[Install]\nWantedBy=multi-user.target"
}
]
},
"filesystems": [
{
"device": "/dev/sdc",
"format": "ext4",
"label": "docker",
"path": "/var/lib/docker",
"wipeFilesystem": true
},
{
"device": "/dev/sdb",
"format": "ext4",
"label": "dockerdata",
"path": "/dockerdata",
"wipeFilesystem": true
}
],
"passwd": {
"users": [
{
"name": "core",
"groups": [
"sudo"
],
"sshAuthorizedKeys": [
"ssh-rsa AAAAB..."
]
}
]
}
}
The logs do show a warning:
op(1): [finished] loading QEMU firmware config module
parsing config with SHA512: 9e8c794cc53fd4cab4ecf965cfe232f85047d5a9a77f71662ee23de3e2fb92be2731df44beab20ec7959e767871e9f4c3194eb3b7ad3c985ca1fc365b3f8316e
warning at $.filesystems, line 10 col 3: Unused key filesystems
disks: disks passed
Ignition finished successfully
Which is the same thing that ignition-validate shows:
[core@localhost run]$ sudo cat /sys/firmware/qemu_fw_cfg/by_name/opt/com.coreos/config/raw | ignition-validate -
warning at $.filesystems, line 10 col 3: Unused key filesystems
[core@localhost run]$ echo $?
0
but it's just flagged as a warning and ignition-validate returns with a successful exit code.
Operating System Version
fedora/x86_64/coreos/testingat30.20190905.0
Ignition Version
ignition-2.0.1-2.gite75cf24.fc30.x86_64
Environment
QEMU
Expected Behavior
Probably this should error? I guess that's what I'm here to discuss.
Actual Behavior
Warning with no erroring out.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the config-validation path used by ignition-validate and the boot parser, reproducing the supplied JSON and warning output. Determine the intended handling of an unused top-level key, then add or update validation coverage so the validator’s exit status and boot behavior match that decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100