From b855d001b97ef46c4e3839a3c94520d3b95b6c2b Mon Sep 17 00:00:00 2001 From: Yasmin Valim Date: Mon, 2 Dec 2024 14:06:54 -0300 Subject: [PATCH] openshift/v4.18: Stabilize 4.18.0 spec Dropping down to ignition 3.4.0, fcos 1.5.0, base 0.5. Fixes: https://github.com/coreos/butane/issues/564 --- .../{v4_18_exp => v4_18}/result/schema.go | 2 +- .../openshift/{v4_18_exp => v4_18}/schema.go | 4 ++-- .../{v4_18_exp => v4_18}/translate.go | 20 +++++++++---------- .../{v4_18_exp => v4_18}/translate_test.go | 18 ++++++++--------- .../{v4_18_exp => v4_18}/validate.go | 2 +- .../{v4_18_exp => v4_18}/validate_test.go | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) rename config/openshift/{v4_18_exp => v4_18}/result/schema.go (95%) rename config/openshift/{v4_18_exp => v4_18}/schema.go (94%) rename config/openshift/{v4_18_exp => v4_18}/translate.go (95%) rename config/openshift/{v4_18_exp => v4_18}/translate_test.go (98%) rename config/openshift/{v4_18_exp => v4_18}/validate.go (98%) rename config/openshift/{v4_18_exp => v4_18}/validate_test.go (99%) diff --git a/config/openshift/v4_18_exp/result/schema.go b/config/openshift/v4_18/result/schema.go similarity index 95% rename from config/openshift/v4_18_exp/result/schema.go rename to config/openshift/v4_18/result/schema.go index 09b5b597..ad5abd8e 100644 --- a/config/openshift/v4_18_exp/result/schema.go +++ b/config/openshift/v4_18/result/schema.go @@ -15,7 +15,7 @@ package result import ( - "github.com/coreos/ignition/v2/config/v3_6_experimental/types" + "github.com/coreos/ignition/v2/config/v3_4/types" ) const ( diff --git a/config/openshift/v4_18_exp/schema.go b/config/openshift/v4_18/schema.go similarity index 94% rename from config/openshift/v4_18_exp/schema.go rename to config/openshift/v4_18/schema.go index 36df2720..c9da45ad 100644 --- a/config/openshift/v4_18_exp/schema.go +++ b/config/openshift/v4_18/schema.go @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License.) -package v4_18_exp +package v4_18 import ( - fcos "github.com/coreos/butane/config/fcos/v1_7_exp" + fcos "github.com/coreos/butane/config/fcos/v1_5" ) const ROLE_LABEL_KEY = "machineconfiguration.openshift.io/role" diff --git a/config/openshift/v4_18_exp/translate.go b/config/openshift/v4_18/translate.go similarity index 95% rename from config/openshift/v4_18_exp/translate.go rename to config/openshift/v4_18/translate.go index a74f793a..8e1c1105 100644 --- a/config/openshift/v4_18_exp/translate.go +++ b/config/openshift/v4_18/translate.go @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License.) -package v4_18_exp +package v4_18 import ( "net/url" "strings" "github.com/coreos/butane/config/common" - "github.com/coreos/butane/config/openshift/v4_18_exp/result" + "github.com/coreos/butane/config/openshift/v4_18/result" cutil "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_6_experimental/types" + "github.com/coreos/ignition/v2/config/v3_4/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_6Unvalidated(options) + cfg, ts, r := c.Config.ToIgn3_4Unvalidated(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_6Unvalidated translates the config to an Ignition config. It also +// ToIgn63_4Unvalidated 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_6Unvalidated(options common.TranslateOptions) (types.Config, translate.TranslationSet, report.Report) { +func (c Config) ToIgn3_4Unvalidated(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_6Unvalidated(options common.TranslateOptions) (types.Conf return cfg, ts, r } -// ToIgn3_6 translates the config to an Ignition config. It returns a +// ToIgn3_4 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_6(options common.TranslateOptions) (types.Config, report.Report, error) { - cfg, r, err := cutil.Translate(c, "ToIgn3_6Unvalidated", options) +func (c Config) ToIgn3_4(options common.TranslateOptions) (types.Config, report.Report, error) { + cfg, r, err := cutil.Translate(c, "ToIgn3_4Unvalidated", options) return cfg.(types.Config), r, err } @@ -208,7 +208,7 @@ func (c Config) ToIgn3_6(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_6", options) + return cutil.TranslateBytes(input, &Config{}, "ToIgn3_4", 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/translate_test.go similarity index 98% rename from config/openshift/v4_18_exp/translate_test.go rename to config/openshift/v4_18/translate_test.go index 7b8a0f8b..1840c9c0 100644 --- a/config/openshift/v4_18_exp/translate_test.go +++ b/config/openshift/v4_18/translate_test.go @@ -12,22 +12,22 @@ // See the License for the specific language governing permissions and // limitations under the License.) -package v4_18_exp +package v4_18 import ( "fmt" "testing" baseutil "github.com/coreos/butane/base/util" - base "github.com/coreos/butane/base/v0_7_exp" + base "github.com/coreos/butane/base/v0_5" "github.com/coreos/butane/config/common" - fcos "github.com/coreos/butane/config/fcos/v1_7_exp" - "github.com/coreos/butane/config/openshift/v4_18_exp/result" + fcos "github.com/coreos/butane/config/fcos/v1_5" + "github.com/coreos/butane/config/openshift/v4_18/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_6_experimental/types" + "github.com/coreos/ignition/v2/config/v3_4/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_6Unvalidated(common.TranslateOptions{}) + _, _, r := in.ToIgn3_4Unvalidated(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.6.0-experimental", + Version: "3.4.0", }, }, }, @@ -159,7 +159,7 @@ func TestTranslateConfig(t *testing.T) { Spec: result.Spec{ Config: types.Config{ Ignition: types.Ignition{ - Version: "3.6.0-experimental", + Version: "3.4.0", }, 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.6.0-experimental", + Version: "3.4.0", }, Storage: types.Storage{ Filesystems: []types.Filesystem{ diff --git a/config/openshift/v4_18_exp/validate.go b/config/openshift/v4_18/validate.go similarity index 98% rename from config/openshift/v4_18_exp/validate.go rename to config/openshift/v4_18/validate.go index e8e744d0..a45ec606 100644 --- a/config/openshift/v4_18_exp/validate.go +++ b/config/openshift/v4_18/validate.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License.) -package v4_18_exp +package v4_18 import ( "github.com/coreos/butane/config/common" diff --git a/config/openshift/v4_18_exp/validate_test.go b/config/openshift/v4_18/validate_test.go similarity index 99% rename from config/openshift/v4_18_exp/validate_test.go rename to config/openshift/v4_18/validate_test.go index 1fdd1242..22059e21 100644 --- a/config/openshift/v4_18_exp/validate_test.go +++ b/config/openshift/v4_18/validate_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License.) -package v4_18_exp +package v4_18 import ( "fmt"