-
Notifications
You must be signed in to change notification settings - Fork 519
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
prairiedog: treat value-less key differently than "empty" values #2565
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great having test coverage!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧑🔧
Nice work!
According to the boot config docs:
I would expect to have a way to render just
|
|
bd93dc1
to
7e4fd60
Compare
Push above changes approach to value-less keys. Prairiedog now differentiates between value-less keys and keys with empty values. Value-less keys are always written out to the bootconfig with just their key. Updated PR description to include new testing details. I verified the kernel no longer misinterprets value-less keys like |
Before this change, prairedog did no special handling for value-less bootconfig keys and would just write out 'key ='. The kernel is insensitive to whitespace so it would grab the next k/v from the bootconfig and substitute it for the value. With this change, prairiedog now differentiates between value-less keys and keys with empty values (e.g. 'key = ""') both in parsing an existing bootconfig file as well as when it generates the bootconfig initrd from existing settings. When the key is value-less, prariedog will just write out the key without '=' for its line entry in the bootconfig (e.g. just 'key').
7e4fd60
to
e3dd95c
Compare
Push above adds to the unit test to show that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this!
Issue number:
Resolves #2359
Description of changes:
Testing done:
The new unit test passes.
Built aws-k8s-1.23 and passed the following user-data:
Host comes up fine. Prairiedog writes out the bootconfig as expected. Note how
init.splash
is value-less:After a reboot, kernel interprets the bootconfig correctly:
The kernel commandline is written out as expected:
Note how on the kernel command line,
splash
is just written out assplash
for the init param.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.