Skip to content

Commit

Permalink
Merge pull request #66 from bgilbert/mountoptions
Browse files Browse the repository at this point in the history
base/v0_2_exp: translate filesystem.mountOptions field
  • Loading branch information
bgilbert committed Jan 24, 2020
2 parents 0f7ae80 + dda7754 commit b6f985e
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 9 deletions.
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
3 changes: 2 additions & 1 deletion docs/configuration-v1_1-exp.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The Fedora CoreOS configuration is a YAML document conforming to the following specification, with **_italicized_** entries being optional:

* **variant** (string): used to differentiate configs for different operating systems. Must be `fcos` for FCCT.
* **version** (string): the semantic version of the spec for this document. This document is for version `1.0.0` and generates Ignition configs with version `3.0.0`.
* **version** (string): the semantic version of the spec for this document. This document is for version `1.1.0-experimental` and generates Ignition configs with version `3.1.0-experimental`.
* **ignition** (object): metadata about the configuration itself.
* **_config_** (objects): options related to the configuration.
* **_merge_** (list of objects): a list of the configs to be merged to the current config.
Expand Down 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.12
require (
github.com/coreos/go-semver v0.3.0
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
github.com/coreos/ignition/v2 v2.0.1
github.com/coreos/ignition/v2 v2.1.1
github.com/coreos/vcontext v0.0.0-20191017033345-260217907eb5
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/stretchr/testify v1.3.0
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142 h1:3jFq2xL4ZajGK
github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/ignition/v2 v2.0.1 h1:aKZARDpl6rDr83Ur/fUoQ3uuSM0VCLH5nTERkLczJFM=
github.com/coreos/ignition/v2 v2.0.1/go.mod h1:EJP9Gk/u21BPwWa5nT6yYbm5mO0u8JQAAzFqaxgH7Fg=
github.com/coreos/ignition/v2 v2.1.1 h1:siNZchKAWoLeV708X4QWG9chTYhssE93HBKkZx+JJO8=
github.com/coreos/ignition/v2 v2.1.1/go.mod h1:RqmqU64zxarUJa3l4cHtbhcSwfQLpUhv0WVziZwoXvE=
github.com/coreos/vcontext v0.0.0-20190529201340-22b159166068/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE=
github.com/coreos/vcontext v0.0.0-20191017033345-260217907eb5 h1:DjoHHi6+9J7DGYPvBdmszKZLY+ucx2bnA77jf8KIk9M=
github.com/coreos/vcontext v0.0.0-20191017033345-260217907eb5/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE=
Expand All @@ -17,6 +17,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/godbus/dbus v0.0.0-20181025153459-66d97aec3384/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
Expand All @@ -39,6 +40,7 @@ github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb/go.mod h
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk=
github.com/vmware/vmw-ovflib v0.0.0-20170608004843-1f217b9dc714/go.mod h1:jiPk45kn7klhByRvUq5i2vo1RtHKBHj+iWGFpxbXuuI=
golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ github.com/ajeddeloh/go-json
github.com/coreos/go-semver/semver
# github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
github.com/coreos/go-systemd/unit
# github.com/coreos/ignition/v2 v2.0.1
# github.com/coreos/ignition/v2 v2.1.1
github.com/coreos/ignition/v2/config/shared/errors
github.com/coreos/ignition/v2/config/shared/validations
github.com/coreos/ignition/v2/config/util
Expand Down

0 comments on commit b6f985e

Please sign in to comment.