Skip to content

Commit

Permalink
openshift: Properly filter unsupported grub config
Browse files Browse the repository at this point in the history
  • Loading branch information
travier committed Jul 12, 2024
1 parent d26d803 commit 5504eca
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 37 deletions.
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

0 comments on commit 5504eca

Please sign in to comment.