Skip to content
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
5 changes: 5 additions & 0 deletions opts/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ type MountOpt struct {
//
//nolint:gocyclo
func (m *MountOpt) Set(value string) error {
value = strings.TrimSpace(value)
if value == "" {
return errors.New("value is empty")
}

csvReader := csv.NewReader(strings.NewReader(value))
fields, err := csvReader.Read()
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions opts/mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ func TestMountOptErrors(t *testing.T) {
tests := []struct {
doc, value, expErr string
}{
{
doc: "empty value",
expErr: "value is empty",
},
{
doc: "missing tmpfs target",
value: "type=tmpfs",
Expand Down
Loading