Skip to content
Open
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 @@ -84,6 +84,7 @@ var (
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")
ErrMissingKernelArgumentCex = errors.New("'rd.luks.key=/etc/luks/cex.key' must be set as kernel argument when CEX is enabled for the boot device")
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
8 changes: 8 additions & 0 deletions config/openshift/v4_14/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ package v4_14

import (
"net/url"
"reflect"
"strings"

"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_5"
"github.com/coreos/butane/config/openshift/v4_14/result"
cutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"
Expand Down Expand Up @@ -118,6 +120,12 @@ func (c Config) ToMachineConfig4_14Unvalidated(options common.TranslateOptions)
return result.MachineConfig{}, ts, r
}

// If any GRUB settings are provided by the user, return an error.
if !reflect.DeepEqual(c.Grub, fcos.Grub{}) {
r.AddOnError(path.New("yaml", "grub"), common.ErrGrubConfigSupport)
return result.MachineConfig{}, ts, r
}

// wrap
ts = ts.PrefixPaths(path.New("yaml"), path.New("json", "spec", "config"))
mc := result.MachineConfig{
Expand Down
8 changes: 8 additions & 0 deletions config/openshift/v4_15/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ package v4_15

import (
"net/url"
"reflect"
"strings"

"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_5"
"github.com/coreos/butane/config/openshift/v4_15/result"
cutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"
Expand Down Expand Up @@ -118,6 +120,12 @@ func (c Config) ToMachineConfig4_15Unvalidated(options common.TranslateOptions)
return result.MachineConfig{}, ts, r
}

// If any GRUB settings are provided by the user, return an error.
if !reflect.DeepEqual(c.Grub, fcos.Grub{}) {
r.AddOnError(path.New("yaml", "grub"), common.ErrGrubConfigSupport)
return result.MachineConfig{}, ts, r
}

// wrap
ts = ts.PrefixPaths(path.New("yaml"), path.New("json", "spec", "config"))
mc := result.MachineConfig{
Expand Down
8 changes: 8 additions & 0 deletions config/openshift/v4_16/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ package v4_16

import (
"net/url"
"reflect"
"strings"

"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_5"
"github.com/coreos/butane/config/openshift/v4_16/result"
cutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"
Expand Down Expand Up @@ -118,6 +120,12 @@ func (c Config) ToMachineConfig4_16Unvalidated(options common.TranslateOptions)
return result.MachineConfig{}, ts, r
}

// If any GRUB settings are provided by the user, return an error.
if !reflect.DeepEqual(c.Grub, fcos.Grub{}) {
r.AddOnError(path.New("yaml", "grub"), common.ErrGrubConfigSupport)
return result.MachineConfig{}, ts, r
}

// wrap
ts = ts.PrefixPaths(path.New("yaml"), path.New("json", "spec", "config"))
mc := result.MachineConfig{
Expand Down
8 changes: 8 additions & 0 deletions config/openshift/v4_17/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ package v4_17

import (
"net/url"
"reflect"
"strings"

"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_5"
"github.com/coreos/butane/config/openshift/v4_17/result"
cutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"
Expand Down Expand Up @@ -118,6 +120,12 @@ func (c Config) ToMachineConfig4_17Unvalidated(options common.TranslateOptions)
return result.MachineConfig{}, ts, r
}

// If any GRUB settings are provided by the user, return an error.
if !reflect.DeepEqual(c.Grub, fcos.Grub{}) {
r.AddOnError(path.New("yaml", "grub"), common.ErrGrubConfigSupport)
return result.MachineConfig{}, ts, r
}

// wrap
ts = ts.PrefixPaths(path.New("yaml"), path.New("json", "spec", "config"))
mc := result.MachineConfig{
Expand Down
8 changes: 8 additions & 0 deletions config/openshift/v4_18/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ package v4_18

import (
"net/url"
"reflect"
"strings"

"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_5"
"github.com/coreos/butane/config/openshift/v4_18/result"
cutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"
Expand Down Expand Up @@ -118,6 +120,12 @@ func (c Config) ToMachineConfig4_18Unvalidated(options common.TranslateOptions)
return result.MachineConfig{}, ts, r
}

// If any GRUB settings are provided by the user, return an error.
if !reflect.DeepEqual(c.Grub, fcos.Grub{}) {
r.AddOnError(path.New("yaml", "grub"), common.ErrGrubConfigSupport)
return result.MachineConfig{}, ts, r
}

// wrap
ts = ts.PrefixPaths(path.New("yaml"), path.New("json", "spec", "config"))
mc := result.MachineConfig{
Expand Down
8 changes: 8 additions & 0 deletions config/openshift/v4_19/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ package v4_19

import (
"net/url"
"reflect"
"strings"

"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_6"
"github.com/coreos/butane/config/openshift/v4_19/result"
cutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"
Expand Down Expand Up @@ -118,6 +120,12 @@ func (c Config) ToMachineConfig4_19Unvalidated(options common.TranslateOptions)
return result.MachineConfig{}, ts, r
}

// If any GRUB settings are provided by the user, return an error.
if !reflect.DeepEqual(c.Grub, fcos.Grub{}) {
r.AddOnError(path.New("yaml", "grub"), common.ErrGrubConfigSupport)
return result.MachineConfig{}, ts, r
}

// wrap
ts = ts.PrefixPaths(path.New("yaml"), path.New("json", "spec", "config"))
mc := result.MachineConfig{
Expand Down
Loading