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

openshift: Properly filter unsupported grub config #542

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/common/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var (
ErrUserFieldSupport = errors.New("fields other than \"name\", \"ssh_authorized_keys\", and \"password_hash\" (4.13.0+) are not supported in this spec version")
ErrUserNameSupport = errors.New("users other than \"core\" are not supported in this spec version")
ErrKernelArgumentSupport = errors.New("this section cannot be used for kernel arguments in this spec version; use openshift.kernel_arguments instead")
ErrGrubConfigSupport = errors.New("GRUB configuration is not supported in this version")

// Storage
ErrClevisSupport = errors.New("clevis is not supported in this spec version")
Expand Down
2 changes: 2 additions & 0 deletions config/openshift/v4_14/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ var (
// link support in the MCO, consider what should happen if
// the user specifies a storage.tree that includes symlinks.
"spec.config.storage.links": common.ErrLinkSupport,
// FORBIDDEN
"spec.config.grub": common.ErrGrubConfigSupport,
})
)

Expand Down
2 changes: 2 additions & 0 deletions config/openshift/v4_15/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ var (
// link support in the MCO, consider what should happen if
// the user specifies a storage.tree that includes symlinks.
"spec.config.storage.links": common.ErrLinkSupport,
// FORBIDDEN
"spec.config.grub": common.ErrGrubConfigSupport,
})
)

Expand Down
2 changes: 2 additions & 0 deletions config/openshift/v4_16/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ var (
// link support in the MCO, consider what should happen if
// the user specifies a storage.tree that includes symlinks.
"spec.config.storage.links": common.ErrLinkSupport,
// FORBIDDEN
"spec.config.grub.users.name": common.ErrGrubConfigSupport,
})
)

Expand Down
37 changes: 0 additions & 37 deletions internal/doc/butane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,43 +349,6 @@ root:
children:
- name: devices
desc: the list of whole-disk devices (not partitions) to include in the disk array, referenced by their absolute path. At least two devices must be specified.
- name: grub
after: $
desc: describes the desired GRUB bootloader configuration.
transforms:
- regex: ".*"
replacement: "Unsupported"
if:
- variant: openshift
max: 4.16.0
children:
- name: users
desc: the list of GRUB superusers.
transforms:
- regex: ".*"
replacement: "Unsupported"
if:
- variant: openshift
max: 4.16.0
children:
- name: name
desc: the user name.
transforms:
- regex: ".*"
replacement: "Unsupported"
if:
- variant: openshift
max: 4.16.0
- name: password_hash
desc: the PBKDF2 password hash, generated with `grub2-mkpasswd-pbkdf2`.
# required by validation
required: true
transforms:
- regex: ".*"
replacement: "Unsupported"
if:
- variant: openshift
max: 4.16.0
- name: openshift
after: $
desc: describes miscellaneous OpenShift configuration. Respected when rendering to a MachineConfig, ignored when rendering directly to an Ignition config.
Expand Down
Loading