Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Fixed issue with ignition_filesystem when empty options passed in #5

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ignition/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ func hash(s string) string {
func castSliceInterface(i []interface{}) []string {
var o []string
for _, value := range i {
if value == nil {
continue
}
o = append(o, value.(string))
}

Expand Down
13 changes: 12 additions & 1 deletion ignition/resource_ignition_filesystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,27 @@ func TestIngnitionFilesystem(t *testing.T) {
}
}

data "ignition_filesystem" "zaz" {
name = "zaz"
mount {
device = "/zaz"
format = "ext4"
create = true
options = [""]
}
}

data "ignition_config" "test" {
filesystems = [
"${data.ignition_filesystem.foo.id}",
"${data.ignition_filesystem.qux.id}",
"${data.ignition_filesystem.baz.id}",
"${data.ignition_filesystem.bar.id}",
"${data.ignition_filesystem.zaz.id}",
]
}
`, func(c *types.Config) error {
if len(c.Storage.Filesystems) != 4 {
if len(c.Storage.Filesystems) != 5 {
return fmt.Errorf("disks, found %d", len(c.Storage.Filesystems))
}

Expand Down