Skip to content

Commit

Permalink
base/v0_2_exp: translate filesystem.mountOptions field
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilbert committed Jan 24, 2020
1 parent e6c420e commit dda7754
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions base/v0_2_exp/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ type Filesystem struct {
Device string `yaml:"device"`
Format *string `yaml:"format"`
Label *string `yaml:"label"`
MountOptions []string `yaml:"mount_options"`
Options []string `yaml:"options"`
Path *string `yaml:"path"`
UUID *string `yaml:"uuid"`
Expand Down
3 changes: 2 additions & 1 deletion base/v0_2_exp/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ func translateLink(from Link) (to types.Link, tm translate.TranslationSet) {

func translateFilesystem(from Filesystem) (to types.Filesystem, tm translate.TranslationSet) {
tr := translate.NewTranslator("yaml", "json")
tm = tr.Translate(&from.Options, &to.Options).Prefix("options")
tm = tr.Translate(&from.MountOptions, &to.MountOptions).Prefix("mount_options")
tm.MergeP("options", tr.Translate(&from.Options, &to.Options))
to.Device = from.Device
to.Label = from.Label
to.Format = from.Format
Expand Down
2 changes: 2 additions & 0 deletions base/v0_2_exp/translate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func TestTranslateFilesystem(t *testing.T) {
Device: "/foo",
Format: util.StrToPtr("/bar"),
Label: util.StrToPtr("/baz"),
MountOptions: []string{"yes", "no", "maybe"},
Options: []string{"foo", "foo", "bar"},
Path: util.StrToPtr("/quux"),
UUID: util.StrToPtr("1234"),
Expand All @@ -300,6 +301,7 @@ func TestTranslateFilesystem(t *testing.T) {
Device: "/foo",
Format: util.StrToPtr("/bar"),
Label: util.StrToPtr("/baz"),
MountOptions: []types.MountOption{"yes", "no", "maybe"},
Options: []types.FilesystemOption{"foo", "foo", "bar"},
Path: util.StrToPtr("/quux"),
UUID: util.StrToPtr("1234"),
Expand Down
1 change: 1 addition & 0 deletions docs/configuration-v1_1-exp.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The Fedora CoreOS configuration is a YAML document conforming to the following s
* **_label_** (string): the label of the filesystem.
* **_uuid_** (string): the uuid of the filesystem.
* **_options_** (list of strings): any additional options to be passed to the format-specific mkfs utility.
* **_mount_options_** (list of strings): any special options to be passed to the mount command.
* **_with_mount_unit_** (bool): Whether to generate a generic mount unit for this filesystem as well. If a more specific unit is needed, a custom one can be specified in the `systemd.units` section. The unit will be named with the [escaped][systemd-escape] version of the `path`.
* **_files_** (list of objects): the list of files to be written. Every file, directory and link must have a unique `path`.
* **path** (string): the absolute path to the file.
Expand Down

0 comments on commit dda7754

Please sign in to comment.