From 9216cc6019a47c10a84aae9d309a2d85a05d2dac Mon Sep 17 00:00:00 2001 From: Steven Presti Date: Fri, 22 Nov 2024 09:07:37 -0500 Subject: [PATCH] *_exp: update ignition import to reflect latest version update naming from 3_5 to 3_6 and replace import statements on all config/distro/*_exp and base_exp --- base/v0_7_exp/translate.go | 6 +++--- base/v0_7_exp/translate_test.go | 18 +++++++++--------- base/v0_7_exp/util.go | 2 +- config/config.go | 8 ++++---- config/fcos/v1_7_exp/translate.go | 20 ++++++++++---------- config/fcos/v1_7_exp/translate_test.go | 6 +++--- config/fcos/v1_7_exp/validate_test.go | 2 +- config/fiot/v1_2_exp/translate.go | 14 +++++++------- config/fiot/v1_2_exp/translate_test.go | 2 +- config/flatcar/v1_3_exp/translate.go | 14 +++++++------- config/flatcar/v1_3_exp/translate_test.go | 2 +- config/openshift/v4_18_exp/result/schema.go | 2 +- config/openshift/v4_18_exp/translate.go | 16 ++++++++-------- config/openshift/v4_18_exp/translate_test.go | 10 +++++----- config/r4e/v1_3_exp/translate.go | 14 +++++++------- config/r4e/v1_3_exp/translate_test.go | 2 +- 16 files changed, 69 insertions(+), 69 deletions(-) diff --git a/base/v0_7_exp/translate.go b/base/v0_7_exp/translate.go index e6ea958d..6d4f65f2 100644 --- a/base/v0_7_exp/translate.go +++ b/base/v0_7_exp/translate.go @@ -29,7 +29,7 @@ import ( "github.com/coreos/go-systemd/v22/unit" "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" ) @@ -75,10 +75,10 @@ RequiredBy=local-fs.target {{- end }}`)) ) -// ToIgn3_5Unvalidated translates the config to an Ignition config. It also returns the set of translations +// 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) { ret := types.Config{} tr := translate.NewTranslator("yaml", "json", options) diff --git a/base/v0_7_exp/translate_test.go b/base/v0_7_exp/translate_test.go index f703656b..6e52f937 100644 --- a/base/v0_7_exp/translate_test.go +++ b/base/v0_7_exp/translate_test.go @@ -30,7 +30,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" "github.com/stretchr/testify/assert" @@ -765,7 +765,7 @@ func TestTranslateFilesystem(t *testing.T) { }, } expected := []types.Filesystem{test.out} - actual, translations, r := in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := in.ToIgn3_6Unvalidated(common.TranslateOptions{}) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.in, r) assert.Equal(t, expected, actual.Storage.Filesystems, "translation mismatch") @@ -1189,7 +1189,7 @@ RequiredBy=swap.target`), for i, test := range tests { t.Run(fmt.Sprintf("translate %d", i), func(t *testing.T) { - out, translations, r := test.in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + out, translations, r := test.in.ToIgn3_6Unvalidated(common.TranslateOptions{}) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.in, r) assert.Equal(t, test.out, out, "bad output") @@ -1716,7 +1716,7 @@ func TestTranslateTree(t *testing.T) { if test.options != nil { options = *test.options } - actual, translations, r := config.ToIgn3_5Unvalidated(options) + actual, translations, r := config.ToIgn3_6Unvalidated(options) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, config, r) @@ -1871,7 +1871,7 @@ func TestTranslateKernelArguments(t *testing.T) { } for i, test := range tests { t.Run(fmt.Sprintf("translate %d", i), func(t *testing.T) { - actual, translations, r := test.in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.in.ToIgn3_6Unvalidated(common.TranslateOptions{}) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.in, r) assert.Equal(t, test.out, actual, "translation mismatch") @@ -1946,7 +1946,7 @@ func TestTranslateTang(t *testing.T) { } for i, test := range tests { t.Run(fmt.Sprintf("translate %d", i), func(t *testing.T) { - actual, translations, r := test.in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.in.ToIgn3_6Unvalidated(common.TranslateOptions{}) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.in, r) assert.Equal(t, test.out, actual, "translation mismatch") @@ -2335,9 +2335,9 @@ func TestTranslateUnitLocal(t *testing.T) { } } -// TestToIgn3_5 tests the config.ToIgn3_5 function ensuring it will generate a valid config even when empty. Not much else is +// TestToIgn3_6 tests the config.ToIgn3_6 function ensuring it will generate a valid config even when empty. Not much else is // tested since it uses the Ignition translation code which has its own set of tests. -func TestToIgn3_5(t *testing.T) { +func TestToIgn3_6(t *testing.T) { tests := []struct { in Config out types.Config @@ -2353,7 +2353,7 @@ func TestToIgn3_5(t *testing.T) { } for i, test := range tests { t.Run(fmt.Sprintf("translate %d", i), func(t *testing.T) { - actual, translations, r := test.in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.in.ToIgn3_6Unvalidated(common.TranslateOptions{}) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.in, r) assert.Equal(t, test.out, actual, "translation mismatch") diff --git a/base/v0_7_exp/util.go b/base/v0_7_exp/util.go index d6b08dde..dbbd7d29 100644 --- a/base/v0_7_exp/util.go +++ b/base/v0_7_exp/util.go @@ -15,7 +15,7 @@ package v0_7_exp import ( - "github.com/coreos/ignition/v2/config/v3_5/types" + "github.com/coreos/ignition/v2/config/v3_6_experimental/types" ) type nodeTracker struct { diff --git a/config/config.go b/config/config.go index 8dc4035e..a5708260 100644 --- a/config/config.go +++ b/config/config.go @@ -72,11 +72,11 @@ func init() { RegisterTranslator("fcos", "1.4.0", fcos1_4.ToIgn3_3Bytes) RegisterTranslator("fcos", "1.5.0", fcos1_5.ToIgn3_4Bytes) RegisterTranslator("fcos", "1.6.0", fcos1_6.ToIgn3_5Bytes) - RegisterTranslator("fcos", "1.7.0-experimental", fcos1_7_exp.ToIgn3_5Bytes) + RegisterTranslator("fcos", "1.7.0-experimental", fcos1_7_exp.ToIgn3_6Bytes) RegisterTranslator("flatcar", "1.0.0", flatcar1_0.ToIgn3_3Bytes) RegisterTranslator("flatcar", "1.1.0", flatcar1_1.ToIgn3_4Bytes) RegisterTranslator("flatcar", "1.2.0", flatcar1_2.ToIgn3_5Bytes) - RegisterTranslator("flatcar", "1.3.0-experimental", flatcar1_3_exp.ToIgn3_5Bytes) + RegisterTranslator("flatcar", "1.3.0-experimental", flatcar1_3_exp.ToIgn3_6Bytes) RegisterTranslator("openshift", "4.8.0", openshift4_8.ToConfigBytes) RegisterTranslator("openshift", "4.9.0", openshift4_9.ToConfigBytes) RegisterTranslator("openshift", "4.10.0", openshift4_10.ToConfigBytes) @@ -91,10 +91,10 @@ func init() { RegisterTranslator("r4e", "1.0.0", r4e1_0.ToIgn3_3Bytes) RegisterTranslator("r4e", "1.1.0", r4e1_1.ToIgn3_4Bytes) RegisterTranslator("r4e", "1.2.0", r4e1_2.ToIgn3_5Bytes) - RegisterTranslator("r4e", "1.3.0-experimental", r4e1_3_exp.ToIgn3_5Bytes) + RegisterTranslator("r4e", "1.3.0-experimental", r4e1_3_exp.ToIgn3_6Bytes) RegisterTranslator("fiot", "1.0.0", fiot1_0.ToIgn3_4Bytes) RegisterTranslator("fiot", "1.1.0", fiot1_1.ToIgn3_5Bytes) - RegisterTranslator("fiot", "1.2.0-experimental", fiot1_2_exp.ToIgn3_5Bytes) + RegisterTranslator("fiot", "1.2.0-experimental", fiot1_2_exp.ToIgn3_6Bytes) RegisterTranslator("rhcos", "0.1.0", unsupportedRhcosVariant) } diff --git a/config/fcos/v1_7_exp/translate.go b/config/fcos/v1_7_exp/translate.go index 02d0a1b5..bd31358e 100644 --- a/config/fcos/v1_7_exp/translate.go +++ b/config/fcos/v1_7_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" ) @@ -60,12 +60,12 @@ func (c Config) FieldFilters() *cutil.FieldFilters { return nil } -// 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) { - ret, ts, r := c.Config.ToIgn3_5Unvalidated(options) +func (c Config) ToIgn3_6Unvalidated(options common.TranslateOptions) (types.Config, translate.TranslationSet, report.Report) { + ret, ts, r := c.Config.ToIgn3_6Unvalidated(options) if r.IsFatal() { return types.Config{}, translate.TranslationSet{}, r } @@ -92,20 +92,20 @@ func (c Config) ToIgn3_5Unvalidated(options common.TranslateOptions) (types.Conf return ret, 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 } -// ToIgn3_5Bytes translates from a v1.6 Butane config to a v3.5.0 Ignition config. It returns a report of any errors or +// ToIgn3_6Bytes translates from a v1.6 Butane config to a v3.5.0 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 ToIgn3_5Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { - return cutil.TranslateBytes(input, &Config{}, "ToIgn3_5", options) +func ToIgn3_6Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { + return cutil.TranslateBytes(input, &Config{}, "ToIgn3_6", options) } func (c Config) processBootDevice(config *types.Config, ts *translate.TranslationSet, options common.TranslateOptions) report.Report { diff --git a/config/fcos/v1_7_exp/translate_test.go b/config/fcos/v1_7_exp/translate_test.go index 051f3584..bc201c88 100644 --- a/config/fcos/v1_7_exp/translate_test.go +++ b/config/fcos/v1_7_exp/translate_test.go @@ -25,7 +25,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" "github.com/stretchr/testify/assert" @@ -1495,7 +1495,7 @@ func TestTranslateBootDevice(t *testing.T) { for i, test := range tests { t.Run(fmt.Sprintf("translate %d", i), func(t *testing.T) { - actual, translations, r := test.in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.in.ToIgn3_6Unvalidated(common.TranslateOptions{}) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.in, r) assert.Equal(t, test.out, actual, "translation mismatch") @@ -1627,7 +1627,7 @@ func TestTranslateGrub(t *testing.T) { for i, test := range tests { t.Run(fmt.Sprintf("translate %d", i), func(t *testing.T) { - actual, translations, r := test.in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.in.ToIgn3_6Unvalidated(common.TranslateOptions{}) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.in, r) assert.Equal(t, test.out, actual, "translation mismatch") diff --git a/config/fcos/v1_7_exp/validate_test.go b/config/fcos/v1_7_exp/validate_test.go index 50f53258..9ba9066b 100644 --- a/config/fcos/v1_7_exp/validate_test.go +++ b/config/fcos/v1_7_exp/validate_test.go @@ -120,7 +120,7 @@ func TestReportCorrelation(t *testing.T) { for i, test := range tests { t.Run(fmt.Sprintf("validate %d", i), func(t *testing.T) { - _, r, _ := ToIgn3_5Bytes([]byte(test.in), common.TranslateBytesOptions{}) + _, r, _ := ToIgn3_6Bytes([]byte(test.in), common.TranslateBytesOptions{}) assert.Len(t, r.Entries, 1, "unexpected report length") assert.Equal(t, test.message, r.Entries[0].Message, "bad error") assert.NotNil(t, r.Entries[0].Marker.StartP, "marker start is nil") diff --git a/config/fiot/v1_2_exp/translate.go b/config/fiot/v1_2_exp/translate.go index cce6d222..cde4d4a0 100644 --- a/config/fiot/v1_2_exp/translate.go +++ b/config/fiot/v1_2_exp/translate.go @@ -18,7 +18,7 @@ import ( "github.com/coreos/butane/config/common" cutil "github.com/coreos/butane/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/report" ) @@ -37,18 +37,18 @@ func (c Config) FieldFilters() *cutil.FieldFilters { return &fieldFilters } -// 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 } -// ToIgn3_5Bytes translates from a v1.2 Butane config to a v3.5.0 Ignition config. It returns a report of any errors or +// ToIgn3_6Bytes translates from a v1.2 Butane config to a v3.5.0 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 ToIgn3_5Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { - return cutil.TranslateBytes(input, &Config{}, "ToIgn3_5", options) +func ToIgn3_6Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { + return cutil.TranslateBytes(input, &Config{}, "ToIgn3_6", options) } diff --git a/config/fiot/v1_2_exp/translate_test.go b/config/fiot/v1_2_exp/translate_test.go index 9bdc17a6..e1c26f84 100644 --- a/config/fiot/v1_2_exp/translate_test.go +++ b/config/fiot/v1_2_exp/translate_test.go @@ -169,7 +169,7 @@ func TestTranslateInvalid(t *testing.T) { for _, entry := range test.Entries { expectedReport.AddOnError(entry.Path, entry.Err) } - actual, translations, r := test.In.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.In.ToIgn3_6Unvalidated(common.TranslateOptions{}) r.Merge(fieldFilters.Verify(actual)) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.In, r) diff --git a/config/flatcar/v1_3_exp/translate.go b/config/flatcar/v1_3_exp/translate.go index 81ea4612..ebda220e 100644 --- a/config/flatcar/v1_3_exp/translate.go +++ b/config/flatcar/v1_3_exp/translate.go @@ -18,7 +18,7 @@ import ( "github.com/coreos/butane/config/common" cutil "github.com/coreos/butane/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/report" ) @@ -33,18 +33,18 @@ func (c Config) FieldFilters() *cutil.FieldFilters { return &fieldFilters } -// 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 } -// ToIgn3_5Bytes translates from a v1.2 Butane config to a v3.5.0 Ignition config. It returns a report of any errors or +// ToIgn3_6Bytes translates from a v1.2 Butane config to a v3.5.0 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 ToIgn3_5Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { - return cutil.TranslateBytes(input, &Config{}, "ToIgn3_5", options) +func ToIgn3_6Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { + return cutil.TranslateBytes(input, &Config{}, "ToIgn3_6", options) } diff --git a/config/flatcar/v1_3_exp/translate_test.go b/config/flatcar/v1_3_exp/translate_test.go index 5b6fefe4..7ac265d4 100644 --- a/config/flatcar/v1_3_exp/translate_test.go +++ b/config/flatcar/v1_3_exp/translate_test.go @@ -69,7 +69,7 @@ func TestTranslation(t *testing.T) { for _, entry := range test.entries { expectedReport.AddOn(entry.path, entry.err, entry.kind) } - actual, translations, r := test.in.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.in.ToIgn3_6Unvalidated(common.TranslateOptions{}) if test.in.FieldFilters() != nil { r.Merge(test.in.FieldFilters().Verify(actual)) } 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/translate.go b/config/openshift/v4_18_exp/translate.go index 09d22bb7..8928acff 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,12 +194,12 @@ 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 } @@ -208,7 +208,7 @@ func (c Config) ToIgn3_5(options common.TranslateOptions) (types.Config, report. // 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 168f1b81..7b8a0f8b 100644 --- a/config/openshift/v4_18_exp/translate_test.go +++ b/config/openshift/v4_18_exp/translate_test.go @@ -27,7 +27,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" "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{ diff --git a/config/r4e/v1_3_exp/translate.go b/config/r4e/v1_3_exp/translate.go index 6a0eec0e..1b7f55ed 100644 --- a/config/r4e/v1_3_exp/translate.go +++ b/config/r4e/v1_3_exp/translate.go @@ -18,7 +18,7 @@ import ( "github.com/coreos/butane/config/common" cutil "github.com/coreos/butane/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/report" ) @@ -37,18 +37,18 @@ func (c Config) FieldFilters() *cutil.FieldFilters { return &fieldFilters } -// 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 } -// ToIgn3_5Bytes translates from a v1.2 Butane config to a v3.5.0 Ignition config. It returns a report of any errors or +// ToIgn3_6Bytes translates from a v1.2 Butane config to a v3.5.0 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 ToIgn3_5Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { - return cutil.TranslateBytes(input, &Config{}, "ToIgn3_5", options) +func ToIgn3_6Bytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) { + return cutil.TranslateBytes(input, &Config{}, "ToIgn3_6", options) } diff --git a/config/r4e/v1_3_exp/translate_test.go b/config/r4e/v1_3_exp/translate_test.go index 7d34e15a..56db7fc9 100644 --- a/config/r4e/v1_3_exp/translate_test.go +++ b/config/r4e/v1_3_exp/translate_test.go @@ -169,7 +169,7 @@ func TestTranslateInvalid(t *testing.T) { for _, entry := range test.Entries { expectedReport.AddOnError(entry.Path, entry.Err) } - actual, translations, r := test.In.ToIgn3_5Unvalidated(common.TranslateOptions{}) + actual, translations, r := test.In.ToIgn3_6Unvalidated(common.TranslateOptions{}) r.Merge(fieldFilters.Verify(actual)) r = confutil.TranslateReportPaths(r, translations) baseutil.VerifyReport(t, test.In, r)