-
Notifications
You must be signed in to change notification settings - Fork 70
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
v1_5_exp: Add sugar to create user.cfg #339
Conversation
58241fa
to
7bf3c16
Compare
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.
Let's mention coreos/fedora-coreos-tracker#134 in the commit message.
7bf3c16
to
808bc61
Compare
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.
Thanks for handling this! There are some details, but this has the right general idea. 👍
Can you paste here an example config? |
This is essentially making |
As I mentioned in #339 (comment), I think we should actively discourage users from making arbitrary changes to their GRUB configuration. By limiting the available sugar and not documenting how to make arbitrary changes, we can make |
Example Config: variant: fcos
version: 1.5.0-experimental
grub:
users:
- user: root
key: grub.pbkdf2.sha512.10000.874A958E526409... Note: |
808bc61
to
987b9d6
Compare
2198a2e
to
736f01e
Compare
Rebased |
736f01e
to
3ca169a
Compare
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.
Code generally looks good! Just a pile of small cleanups. 🧹
3ca169a
to
8551e4b
Compare
Currently, if a parent Butane config and a child Butane config both specify In principle we could provide the usual semantics by having the sugar use
|
Verified this: the old password does not work after a second |
(And I assume it's okay to list the same user twice in |
This is true, but this resets any previously defined password for that user. So in practice if no new password is set, we just get a username where the password has been thrown away. |
To be clear, are you saying that I think that's actually okay. As long as we define |
8551e4b
to
fbdd1b4
Compare
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.
Thanks for switching to append
. This should currently fail validation in the openshift
experimental spec. Want to add some translation code there to find the user.cfg
entry and convert its append
to contents
?
fbdd1b4
to
06bafa7
Compare
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.
Thanks for making the additional changes!
We want to add sugar to butane which will allow users to indirectly modify the GRUB configuration. The sugar added here will abstract the mounting of /boot and will allow users to create /boot/grub2/user.cfg which is sourced by grub.cfg. related: coreos/fedora-coreos-tracker#134
Let's document the newly added GRUB functionality and add an example config showing users how to use it.
06bafa7
to
f195669
Compare
4b611cb
to
2efc84e
Compare
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.
Almost there; just some small fixes.
2efc84e
to
41e7009
Compare
41e7009
to
c3a5a78
Compare
translate/set.go
Outdated
func (ts TranslationSet) AddFromCommonObject(fromPrefix path.ContextPath, toPrefix path.ContextPath, to interface{}) { | ||
vTo := reflect.ValueOf(to) | ||
vPathsTo := prefixPaths(getAllPaths(vTo, ts.ToTag, true), toPrefix.Path...) | ||
vPathsFrom := prefixPaths(getAllPaths(vTo, ts.FromTag, true), fromPrefix.Path...) |
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.
This is probably okay as-is, but there's an unnecessary implicit assumption that getAllPaths()
returns paths in a consistent order. Possible cleanup: call getAllPaths
once, drop the prefixPaths
calls, and then loop over paths:
ts.AddTranslation(prefixPath(path, fromPrefix.Path...), prefixPath(path, toPrefix.Path...))
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.
It turns out that I've asked you to add a bug here, which is that both sides of the resulting translation are now using ToTag
. I won't ask you to fix it though; I'll handle that in a followup.
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.
Followup in #357.
This is a useful function for copying all the fields of one object to the identically named fields of another object. We add translations prefixed by fromPrefix and toPrefix, retrieving the subpaths from to.
Sugar in FCOS V1.5.0-exp creates a user.cfg file using append; however, append is forbidden for MCO. Let's add special handling that converts user.cfg's append to contents for Openshift V4.12.0-exp.
c3a5a78
to
460bee4
Compare
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.
Thanks for all your hard work on this! 💯 🎆
Awesome! |
We want to add sugar to butane which will allow users to indirectly
modify the GRUB configuration. The sugar added here will abstract
the mounting of
/boot
and will allow users to create/boot/grub2/user.cfg
which is sourced by
grub.cfg
.