Skip to content

Commit

Permalink
update translator
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemric authored and bgilbert committed Jan 13, 2022
1 parent 3726274 commit 191dc87
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/v3_4_experimental/translate/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@ func translateIgnition(old old_types.Ignition) (ret types.Ignition) {
return
}

func translateUnit(old old_types.Unit) (ret types.Unit) {
tr := translate.NewTranslator()
tr.Translate(&old.Contents, &ret.Contents)
tr.Translate(&old.Dropins, &ret.Dropins)
tr.Translate(&old.Enabled, &ret.Enabled)
tr.Translate(&old.Mask, &ret.Mask)
tr.Translate(&old.Name, &ret.Name)
return
}

func Translate(old old_types.Config) (ret types.Config) {
tr := translate.NewTranslator()
tr.AddCustomTranslator(translateIgnition)
tr.AddCustomTranslator(translateUnit)
tr.Translate(&old, &ret)
return
}

0 comments on commit 191dc87

Please sign in to comment.