From 95936d1330d73c13bc71793a67191b15dde41327 Mon Sep 17 00:00:00 2001 From: Steven Presti Date: Tue, 26 Nov 2024 14:58:50 -0500 Subject: [PATCH] openshift/v4_18_exp: update import for fcos and base to latest --- config/openshift/v4_18_exp/result/schema.go | 2 +- config/openshift/v4_18_exp/schema.go | 2 +- config/openshift/v4_18_exp/translate.go | 18 +++++++++--------- config/openshift/v4_18_exp/translate_test.go | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/config/openshift/v4_18_exp/result/schema.go b/config/openshift/v4_18_exp/result/schema.go index 62bc2054..09b5b597 100644 --- a/config/openshift/v4_18_exp/result/schema.go +++ b/config/openshift/v4_18_exp/result/schema.go @@ -15,7 +15,7 @@ package result import ( - "github.com/coreos/ignition/v2/config/v3_5/types" + "github.com/coreos/ignition/v2/config/v3_6_experimental/types" ) const ( diff --git a/config/openshift/v4_18_exp/schema.go b/config/openshift/v4_18_exp/schema.go index b9dfbe4d..36df2720 100644 --- a/config/openshift/v4_18_exp/schema.go +++ b/config/openshift/v4_18_exp/schema.go @@ -15,7 +15,7 @@ package v4_18_exp import ( - fcos "github.com/coreos/butane/config/fcos/v1_6_exp" + fcos "github.com/coreos/butane/config/fcos/v1_7_exp" ) const ROLE_LABEL_KEY = "machineconfiguration.openshift.io/role" diff --git a/config/openshift/v4_18_exp/translate.go b/config/openshift/v4_18_exp/translate.go index 09d22bb7..a74f793a 100644 --- a/config/openshift/v4_18_exp/translate.go +++ b/config/openshift/v4_18_exp/translate.go @@ -24,7 +24,7 @@ import ( "github.com/coreos/butane/translate" "github.com/coreos/ignition/v2/config/util" - "github.com/coreos/ignition/v2/config/v3_5/types" + "github.com/coreos/ignition/v2/config/v3_6_experimental/types" "github.com/coreos/vcontext/path" "github.com/coreos/vcontext/report" ) @@ -113,7 +113,7 @@ func (c Config) FieldFilters() *cutil.FieldFilters { // can be tracked back to their source in the source config. No config // validation is performed on input or output. func (c Config) ToMachineConfig4_18Unvalidated(options common.TranslateOptions) (result.MachineConfig, translate.TranslationSet, report.Report) { - cfg, ts, r := c.Config.ToIgn3_5Unvalidated(options) + cfg, ts, r := c.Config.ToIgn3_6Unvalidated(options) if r.IsFatal() { return result.MachineConfig{}, ts, r } @@ -174,11 +174,11 @@ func (c Config) ToMachineConfig4_18(options common.TranslateOptions) (result.Mac return cfg.(result.MachineConfig), r, err } -// ToIgn3_5Unvalidated translates the config to an Ignition config. It also +// ToIgn3_6Unvalidated translates the config to an Ignition config. It also // returns the set of translations it did so paths in the resultant config // can be tracked back to their source in the source config. No config // validation is performed on input or output. -func (c Config) ToIgn3_5Unvalidated(options common.TranslateOptions) (types.Config, translate.TranslationSet, report.Report) { +func (c Config) ToIgn3_6Unvalidated(options common.TranslateOptions) (types.Config, translate.TranslationSet, report.Report) { mc, ts, r := c.ToMachineConfig4_18Unvalidated(options) cfg := mc.Spec.Config @@ -194,21 +194,21 @@ func (c Config) ToIgn3_5Unvalidated(options common.TranslateOptions) (types.Conf return cfg, ts, r } -// ToIgn3_5 translates the config to an Ignition config. It returns a +// ToIgn3_6 translates the config to an Ignition config. It returns a // report of any errors or warnings in the source and resultant config. If // the report has fatal errors or it encounters other problems translating, // an error is returned. -func (c Config) ToIgn3_5(options common.TranslateOptions) (types.Config, report.Report, error) { - cfg, r, err := cutil.Translate(c, "ToIgn3_5Unvalidated", options) +func (c Config) ToIgn3_6(options common.TranslateOptions) (types.Config, report.Report, error) { + cfg, r, err := cutil.Translate(c, "ToIgn3_6Unvalidated", options) return cfg.(types.Config), r, err } -// ToConfigBytes translates from a v4.17 Butane config to a v4.17 MachineConfig or a v3.5.0 Ignition config. It returns a report of any errors or +// ToConfigBytes translates from a v4.17 Butane config to a v4.17 MachineConfig or a v3.6.0-experimental Ignition config. It returns a report of any errors or // warnings in the source and resultant config. If the report has fatal errors or it encounters other problems // translating, an error is returned. func ToConfigBytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { if options.Raw { - return cutil.TranslateBytes(input, &Config{}, "ToIgn3_5", options) + return cutil.TranslateBytes(input, &Config{}, "ToIgn3_6", options) } else { return cutil.TranslateBytesYAML(input, &Config{}, "ToMachineConfig4_18", options) } diff --git a/config/openshift/v4_18_exp/translate_test.go b/config/openshift/v4_18_exp/translate_test.go index 796814c4..7b8a0f8b 100644 --- a/config/openshift/v4_18_exp/translate_test.go +++ b/config/openshift/v4_18_exp/translate_test.go @@ -19,15 +19,15 @@ import ( "testing" baseutil "github.com/coreos/butane/base/util" - base "github.com/coreos/butane/base/v0_6_exp" + base "github.com/coreos/butane/base/v0_7_exp" "github.com/coreos/butane/config/common" - fcos "github.com/coreos/butane/config/fcos/v1_6_exp" + fcos "github.com/coreos/butane/config/fcos/v1_7_exp" "github.com/coreos/butane/config/openshift/v4_18_exp/result" confutil "github.com/coreos/butane/config/util" "github.com/coreos/butane/translate" "github.com/coreos/ignition/v2/config/util" - "github.com/coreos/ignition/v2/config/v3_5/types" + "github.com/coreos/ignition/v2/config/v3_6_experimental/types" "github.com/coreos/vcontext/path" "github.com/coreos/vcontext/report" "github.com/stretchr/testify/assert" @@ -52,7 +52,7 @@ func TestElidedFieldWarning(t *testing.T) { expected.AddOnWarn(path.New("yaml", "openshift", "fips"), common.ErrFieldElided) expected.AddOnWarn(path.New("yaml", "openshift", "kernel_type"), common.ErrFieldElided) - _, _, r := in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + _, _, r := in.ToIgn3_6Unvalidated(common.TranslateOptions{}) assert.Equal(t, expected, r, "report mismatch") } @@ -84,7 +84,7 @@ func TestTranslateConfig(t *testing.T) { Spec: result.Spec{ Config: types.Config{ Ignition: types.Ignition{ - Version: "3.5.0", + Version: "3.6.0-experimental", }, }, }, @@ -159,7 +159,7 @@ func TestTranslateConfig(t *testing.T) { Spec: result.Spec{ Config: types.Config{ Ignition: types.Ignition{ - Version: "3.5.0", + Version: "3.6.0-experimental", }, Storage: types.Storage{ Filesystems: []types.Filesystem{ @@ -304,7 +304,7 @@ func TestTranslateConfig(t *testing.T) { Spec: result.Spec{ Config: types.Config{ Ignition: types.Ignition{ - Version: "3.5.0", + Version: "3.6.0-experimental", }, Storage: types.Storage{ Filesystems: []types.Filesystem{