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

Pull layering/ changes to go modules #3126

Closed
wants to merge 3 commits into from
Closed
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
13 changes: 8 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/clarketm/json v1.14.1
github.com/containers/image/v5 v5.17.0
github.com/containers/storage v1.37.0
github.com/coreos/fcct v0.5.0
github.com/coreos/butane v0.14.0
github.com/coreos/go-semver v0.3.0
github.com/coreos/ign-converter v0.0.0-20201123214124-8dac862888aa
github.com/coreos/ignition v0.35.0
Expand All @@ -29,10 +29,9 @@ require (
github.com/openshift/client-go v0.0.0-20220411091747-c100636b0bc0
github.com/openshift/library-go v0.0.0-20211220195323-eca2c467c492
github.com/openshift/runtime-utils v0.0.0-20220225175100-8dec0d84fb39
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.12.1
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
github.com/stretchr/testify v1.7.0
github.com/vincent-petithory/dataurl v1.0.0
golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b
Expand All @@ -49,6 +48,11 @@ require (
sigs.k8s.io/controller-runtime v0.11.0
)

require (
github.com/coreos/go-json v0.0.0-20211020211907-c63f628265de // indirect
github.com/coreos/vcontext v0.0.0-20211021162308-f1dbbca7bef4 // indirect
)

require (
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a // indirect
github.com/Antonboom/errname v0.1.4 // indirect
Expand Down Expand Up @@ -76,10 +80,8 @@ require (
github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af // indirect
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b // indirect
github.com/containers/ocicrypt v1.1.2 // indirect
github.com/coreos/go-json v0.0.0-20211020211907-c63f628265de // indirect
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/coreos/vcontext v0.0.0-20211021162308-f1dbbca7bef4 // indirect
github.com/daixiang0/gci v0.2.9 // indirect
github.com/denis-tingajkin/go-header v0.4.2 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
Expand Down Expand Up @@ -193,6 +195,7 @@ require (
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polyfloyd/go-errorlint v0.0.0-20210722154253-910bb7978349 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand Down
13 changes: 4 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ github.com/ashcrow/osrelease v0.0.0-20180626175927-9b292693c55c h1:icme0QhxrgZOx
github.com/ashcrow/osrelease v0.0.0-20180626175927-9b292693c55c/go.mod h1:BRljTyotlu+6N+Qlu5MhjxpdmccCnp9lDvZjNNV8qr4=
github.com/auth0/go-jwt-middleware v1.0.1/go.mod h1:YSeUX3z6+TF2H+7padiEqNJ73Zy9vXW72U//IgN0BIM=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.19.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.30.28/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
Expand Down Expand Up @@ -334,10 +333,10 @@ github.com/containers/storage v1.37.0/go.mod h1:kqeJeS0b7DO2ZT1nVWs0XufrmPFbgV3c
github.com/coredns/caddy v1.1.0/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4=
github.com/coredns/corefile-migration v1.0.14/go.mod h1:XnhgULOEouimnzgn0t4WPuFDN2/PJQcTxdWKC5eXNGE=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/butane v0.14.0 h1:1xLt5y6RR8NTmeDf6yMzqP7Jqre8PvJ/1BTXQTxEMhk=
github.com/coreos/butane v0.14.0/go.mod h1:Q5DcBsHDckEZ7IgQSb1MvvkNc50dpoT1lOHdGWwCRjY=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/fcct v0.5.0 h1:f/z+MCoR2vULes+MyoPEApQ6iluy/JbXoRi6dahPItQ=
github.com/coreos/fcct v0.5.0/go.mod h1:cbE+j77YSQwFB2fozWVB3qsI2Pi3YiVEbDz/b6Yywdo=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU=
github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU=
Expand All @@ -362,14 +361,12 @@ github.com/coreos/ign-converter v0.0.0-20201123214124-8dac862888aa h1:oIF6XCee+G
github.com/coreos/ign-converter v0.0.0-20201123214124-8dac862888aa/go.mod h1:pqAsDWa5YDi10Va/aqQI0bwOs9hXqoE2xwb5vnFys5s=
github.com/coreos/ignition v0.35.0 h1:UFodoYq1mOPrbEjtxIsZbThcDyQwAI1owczRDqWmKkQ=
github.com/coreos/ignition v0.35.0/go.mod h1:WJQapxzEn9DE0ryxsGvm8QnBajm/XsS/PkrDqSpz+bA=
github.com/coreos/ignition/v2 v2.1.1/go.mod h1:RqmqU64zxarUJa3l4cHtbhcSwfQLpUhv0WVziZwoXvE=
github.com/coreos/ignition/v2 v2.7.0/go.mod h1:3CjaRpg51hmJzPjarbzB0RvSZbLkNOczxKJobTl6nOY=
github.com/coreos/ignition/v2 v2.13.0 h1:1ouW+d0nOuPUbLjxxOCnC+dWQxynr8Mt5exqJoCD7b4=
github.com/coreos/ignition/v2 v2.13.0/go.mod h1:HO1HWYWcvAIbHu6xewoKxPGBTyZ32FLwGIuipw5d63o=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/vcontext v0.0.0-20190529201340-22b159166068/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE=
github.com/coreos/vcontext v0.0.0-20191017033345-260217907eb5/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE=
github.com/coreos/vcontext v0.0.0-20211021162308-f1dbbca7bef4 h1:pfSsrvbjUFGINaPGy0mm2QKQKTdq7IcbUa+nQwsz2UM=
github.com/coreos/vcontext v0.0.0-20211021162308-f1dbbca7bef4/go.mod h1:HckqHnP/HI41vS0bfVjJ20u6jD0biI5+68QwZm5Xb9U=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
Expand Down Expand Up @@ -1233,8 +1230,9 @@ github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzu
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace h1:9PNP1jnUjRhfmGMlkXHjYPishpcw4jpSt/V/xYY3FMA=
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
Expand Down Expand Up @@ -1494,7 +1492,6 @@ golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down Expand Up @@ -1613,7 +1610,6 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -2006,7 +2002,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20191010095647-fc94e3f71652/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
Expand Down
74 changes: 37 additions & 37 deletions pkg/controller/common/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import (
"strings"

"github.com/clarketm/json"
fcctbase "github.com/coreos/fcct/base/v0_1"
bubase "github.com/coreos/butane/base/v0_3"
bucommon "github.com/coreos/butane/config/common"
fcosbutane "github.com/coreos/butane/config/fcos/v1_2"
"github.com/coreos/ign-converter/translate/v23tov30"
"github.com/coreos/ign-converter/translate/v32tov22"
"github.com/coreos/ign-converter/translate/v32tov31"
Expand Down Expand Up @@ -600,47 +602,54 @@ func removeIgnDuplicateFilesUnitsUsers(ignConfig ign2types.Config) (ign2types.Co
return ignConfig, nil
}

// TranspileCoreOSConfigToIgn transpiles Fedora CoreOS config to ignition
// internally it transpiles to Ign spec v3 config
func TranspileCoreOSConfigToIgn(files, units []string) (*ign3types.Config, error) {
// ConvertButaneFragmentsToIgnition takes as input butane fragments (fcos 1.3) and returns an Ignition v3.2 configuration.
func ConvertButaneFragmentsToIgnition(files, units []string) (*ign3types.Config, error) {
overwrite := true
outConfig := ign3types.Config{}
buCfg := fcosbutane.Config{}
// Convert data to Ignition resources
for _, contents := range files {
f := new(fcctbase.File)
f := new(bubase.File)
if err := yaml.Unmarshal([]byte(contents), f); err != nil {
return nil, fmt.Errorf("failed to unmarshal %q into struct: %w", contents, err)
}
f.Overwrite = &overwrite

// Add the file to the config
var ctCfg fcctbase.Config
ctCfg.Storage.Files = append(ctCfg.Storage.Files, *f)
ign3_0config, tSet, err := ctCfg.ToIgn3_0()
if err != nil {
return nil, fmt.Errorf("failed to transpile config to Ignition config %w\nTranslation set: %v", err, tSet)
}
ign3_2config := translate3.Translate(translate3_1.Translate(ign3_0config))
outConfig = ign3.Merge(outConfig, ign3_2config)
buCfg.Storage.Files = append(buCfg.Storage.Files, *f)
}

dropins := make(map[string]bubase.Unit)
for _, contents := range units {
u := new(fcctbase.Unit)
u := new(bubase.Unit)
if err := yaml.Unmarshal([]byte(contents), u); err != nil {
return nil, fmt.Errorf("failed to unmarshal systemd unit into struct: %w", err)
}

// Add the unit to the config
var ctCfg fcctbase.Config
ctCfg.Systemd.Units = append(ctCfg.Systemd.Units, *u)
ign3_0config, tSet, err := ctCfg.ToIgn3_0()
if err != nil {
return nil, fmt.Errorf("failed to transpile config to Ignition config %w\nTranslation set: %v", err, tSet)
// Handle drop-ins specially; a unit name with drop-ins can be repeated and they should be merged.
if len(u.Dropins) > 0 {
if current, ok := dropins[u.Name]; ok {
current.Dropins = append(current.Dropins, u.Dropins...)
} else {
dropins[u.Name] = *u
}
} else {
buCfg.Systemd.Units = append(buCfg.Systemd.Units, *u)
}
ign3_2config := translate3.Translate(translate3_1.Translate(ign3_0config))
outConfig = ign3.Merge(outConfig, ign3_2config)
}
for _, unit := range dropins {
buCfg.Systemd.Units = append(buCfg.Systemd.Units, unit)
}

// We want the output of this to be reproducible (it should not depend on the order of the filesystem)
sort.Slice(buCfg.Storage.Files, func(i, j int) bool { return buCfg.Storage.Files[i].Path < buCfg.Storage.Files[j].Path })
sort.Slice(buCfg.Systemd.Units, func(i, j int) bool { return buCfg.Systemd.Units[i].Name < buCfg.Systemd.Units[j].Name })
for _, unit := range buCfg.Systemd.Units {
sort.Slice(unit.Dropins, func(i, j int) bool { return unit.Dropins[i].Name < unit.Dropins[j].Name })
}

outConfig, rep, err := buCfg.ToIgn3_2(bucommon.TranslateOptions{})
if err != nil {
return nil, fmt.Errorf("failed to convert butane fragments: %v %w", rep, err)
}
return &outConfig, nil
}

Expand Down Expand Up @@ -789,7 +798,7 @@ func NewIgnFileBytes(path string, contents []byte) ign3types.File {
FileEmbedded1: ign3types.FileEmbedded1{
Contents: ign3types.Resource{
Source: strToPtr(dataurl.EncodeBytes(contents)),
Compression: strToPtr(""),
Compression: strToPtr(""), // See https://github.com/coreos/butane/issues/332
},
},
}
Expand All @@ -798,18 +807,9 @@ func NewIgnFileBytes(path string, contents []byte) ign3types.File {
// NewIgnFileBytesOverwriting is like NewIgnFileBytes, but overwrites existing files by default
func NewIgnFileBytesOverwriting(path string, contents []byte) ign3types.File {
overwrite := true
return ign3types.File{
Node: ign3types.Node{
Path: path,
Overwrite: &overwrite,
},
FileEmbedded1: ign3types.FileEmbedded1{
Contents: ign3types.Resource{
Source: strToPtr(dataurl.EncodeBytes(contents)),
Compression: strToPtr(""), // See https://github.com/coreos/butane/issues/332
},
},
}
r := NewIgnFileBytes(path, contents)
r.Node.Overwrite = &overwrite
return r
}

// GetIgnitionFileDataByPath retrieves the file data for a specified path from a given ignition config
Expand Down
14 changes: 11 additions & 3 deletions pkg/controller/common/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ import (
"github.com/openshift/machine-config-operator/test/helpers"
)

func TestTranspileCoreOSConfig(t *testing.T) {
func TestConvertButaneFragmentsToIgnition(t *testing.T) {
// Test the null case
config, err := ConvertButaneFragmentsToIgnition([]string{}, []string{})
require.NoError(t, err)
if report := validate3.ValidateWithContext(config, nil); report.IsFatal() {
t.Fatalf("invalid ignition V3 config found: %v", report)
}
require.Equal(t, len(config.Storage.Files), 0)

kubeletConfig := `
mode: 0644
path: "/etc/kubernetes/kubelet.conf"
Expand Down Expand Up @@ -58,13 +66,13 @@ dropins:
[Unit]
ConditionPathExists=/enoent
`
config, err := TranspileCoreOSConfigToIgn([]string{kubeletConfig, auditConfig}, []string{kubeletService, crioDropin, dockerDropin})
config, err = ConvertButaneFragmentsToIgnition([]string{kubeletConfig, auditConfig}, []string{kubeletService, crioDropin, dockerDropin})
require.Nil(t, err)
if report := validate3.ValidateWithContext(config, nil); report.IsFatal() {
t.Fatalf("invalid ignition V3 config found: %v", report)
}
require.Equal(t, len(config.Storage.Files), 2)
require.True(t, strings.HasPrefix(*config.Storage.Files[0].Contents.Source, "data:,kind%3A%20KubeletConfiguration%0Aapi"))
require.True(t, strings.HasPrefix(*config.Storage.Files[1].Contents.Source, "data:,kind%3A%20KubeletConfiguration%0Aapi"))
require.Equal(t, len(config.Systemd.Units), 3)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/template/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ func generateMachineConfigForName(config *RenderConfig, role, name, templateDir,
return vs
}

ignCfg, err := ctrlcommon.TranspileCoreOSConfigToIgn(keySortVals(files), keySortVals(units))
ignCfg, err := ctrlcommon.ConvertButaneFragmentsToIgnition(keySortVals(files), keySortVals(units))
if err != nil {
return nil, fmt.Errorf("error transpiling CoreOS config to Ignition config: %w", err)
return nil, fmt.Errorf("error converting Butane fragments to Ignition config: %w", err)
}
mcfg, err := ctrlcommon.MachineConfigFromIgnConfig(role, name, ignCfg)
if err != nil {
Expand Down
Loading