Skip to content

Commit

Permalink
openshift/v4_18_exp: Update spec to 4.18.0-experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
prestist committed Sep 18, 2024
1 parent 6c465de commit 67953ed
Show file tree
Hide file tree
Showing 9 changed files with 204 additions and 17 deletions.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
openshift4_15 "github.com/coreos/butane/config/openshift/v4_15"
openshift4_16 "github.com/coreos/butane/config/openshift/v4_16"
openshift4_17_exp "github.com/coreos/butane/config/openshift/v4_17_exp"
openshift4_18_exp "github.com/coreos/butane/config/openshift/v4_18_exp"
openshift4_8 "github.com/coreos/butane/config/openshift/v4_8"
openshift4_9 "github.com/coreos/butane/config/openshift/v4_9"
r4e1_0 "github.com/coreos/butane/config/r4e/v1_0"
Expand Down Expand Up @@ -80,6 +81,7 @@ func init() {
RegisterTranslator("openshift", "4.15.0", openshift4_15.ToConfigBytes)
RegisterTranslator("openshift", "4.16.0", openshift4_16.ToConfigBytes)
RegisterTranslator("openshift", "4.17.0-experimental", openshift4_17_exp.ToConfigBytes)
RegisterTranslator("openshift", "4.18.0-experimental", openshift4_18_exp.ToConfigBytes)
RegisterTranslator("r4e", "1.0.0", r4e1_0.ToIgn3_3Bytes)
RegisterTranslator("r4e", "1.1.0", r4e1_1.ToIgn3_4Bytes)
RegisterTranslator("r4e", "1.2.0-experimental", r4e1_2_exp.ToIgn3_5Bytes)
Expand Down
2 changes: 1 addition & 1 deletion config/openshift/v4_18_exp/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.)

package v4_17_exp
package v4_18_exp

import (
fcos "github.com/coreos/butane/config/fcos/v1_6_exp"
Expand Down
18 changes: 9 additions & 9 deletions config/openshift/v4_18_exp/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.)

package v4_17_exp
package v4_18_exp

import (
"net/url"
"strings"

"github.com/coreos/butane/config/common"
"github.com/coreos/butane/config/openshift/v4_17_exp/result"
"github.com/coreos/butane/config/openshift/v4_18_exp/result"
cutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"

Expand Down Expand Up @@ -108,11 +108,11 @@ func (c Config) FieldFilters() *cutil.FieldFilters {
return &fieldFilters
}

// ToMachineConfig4_17Unvalidated translates the config to a MachineConfig. It also
// ToMachineConfig4_18Unvalidated translates the config to a MachineConfig. 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) ToMachineConfig4_17Unvalidated(options common.TranslateOptions) (result.MachineConfig, translate.TranslationSet, report.Report) {
func (c Config) ToMachineConfig4_18Unvalidated(options common.TranslateOptions) (result.MachineConfig, translate.TranslationSet, report.Report) {
cfg, ts, r := c.Config.ToIgn3_5Unvalidated(options)
if r.IsFatal() {
return result.MachineConfig{}, ts, r
Expand Down Expand Up @@ -165,12 +165,12 @@ func (c Config) ToMachineConfig4_17Unvalidated(options common.TranslateOptions)
return mc, ts, r
}

// ToMachineConfig4_17 translates the config to a MachineConfig. It returns a
// ToMachineConfig4_18 translates the config to a MachineConfig. 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) ToMachineConfig4_17(options common.TranslateOptions) (result.MachineConfig, report.Report, error) {
cfg, r, err := cutil.Translate(c, "ToMachineConfig4_17Unvalidated", options)
func (c Config) ToMachineConfig4_18(options common.TranslateOptions) (result.MachineConfig, report.Report, error) {
cfg, r, err := cutil.Translate(c, "ToMachineConfig4_18Unvalidated", options)
return cfg.(result.MachineConfig), r, err
}

Expand All @@ -179,7 +179,7 @@ func (c Config) ToMachineConfig4_17(options common.TranslateOptions) (result.Mac
// 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) {
mc, ts, r := c.ToMachineConfig4_17Unvalidated(options)
mc, ts, r := c.ToMachineConfig4_18Unvalidated(options)
cfg := mc.Spec.Config

// report warnings if there are any non-empty fields in Spec (other
Expand Down Expand Up @@ -210,7 +210,7 @@ func ToConfigBytes(input []byte, options common.TranslateBytesOptions) ([]byte,
if options.Raw {
return cutil.TranslateBytes(input, &Config{}, "ToIgn3_5", options)
} else {
return cutil.TranslateBytesYAML(input, &Config{}, "ToMachineConfig4_17", options)
return cutil.TranslateBytesYAML(input, &Config{}, "ToMachineConfig4_18", options)
}
}

Expand Down
8 changes: 4 additions & 4 deletions config/openshift/v4_18_exp/translate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.)

package v4_17_exp
package v4_18_exp

import (
"fmt"
Expand All @@ -22,7 +22,7 @@ import (
base "github.com/coreos/butane/base/v0_6_exp"
"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_6_exp"
"github.com/coreos/butane/config/openshift/v4_17_exp/result"
"github.com/coreos/butane/config/openshift/v4_18_exp/result"
confutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"

Expand Down Expand Up @@ -359,7 +359,7 @@ func TestTranslateConfig(t *testing.T) {

for i, test := range tests {
t.Run(fmt.Sprintf("translate %d", i), func(t *testing.T) {
actual, translations, r := test.in.ToMachineConfig4_17Unvalidated(common.TranslateOptions{})
actual, translations, r := test.in.ToMachineConfig4_18Unvalidated(common.TranslateOptions{})
r = confutil.TranslateReportPaths(r, translations)
baseutil.VerifyReport(t, test.in, r)
assert.Equal(t, test.out, actual, "translation mismatch")
Expand Down Expand Up @@ -587,7 +587,7 @@ func TestValidateSupport(t *testing.T) {
for _, entry := range test.entries {
expectedReport.AddOn(entry.path, entry.err, entry.kind)
}
actual, translations, r := test.in.ToMachineConfig4_17Unvalidated(common.TranslateOptions{})
actual, translations, r := test.in.ToMachineConfig4_18Unvalidated(common.TranslateOptions{})
r.Merge(fieldFilters.Verify(actual))
r = confutil.TranslateReportPaths(r, translations)
baseutil.VerifyReport(t, test.in, r)
Expand Down
2 changes: 1 addition & 1 deletion config/openshift/v4_18_exp/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.)

package v4_17_exp
package v4_18_exp

import (
"github.com/coreos/butane/config/common"
Expand Down
2 changes: 1 addition & 1 deletion config/openshift/v4_18_exp/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.)

package v4_17_exp
package v4_18_exp

import (
"fmt"
Expand Down
Loading

0 comments on commit 67953ed

Please sign in to comment.