Skip to content

Commit b22f1ae

Browse files
authored
Merge pull request #6771 from thaJeztah/allow_empty_target
opts: MountOpt: relax client-side validation of mount target
2 parents ffd9b40 + bcc1455 commit b22f1ae

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

opts/mount.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ func (m *MountOpt) Set(value string) error {
175175
return errors.New("type is required")
176176
}
177177

178-
if mount.Target == "" {
179-
return errors.New("target is required")
180-
}
181-
182178
if mount.VolumeOptions != nil && mount.Type != mounttypes.TypeVolume {
183179
return fmt.Errorf("cannot mix 'volume-*' options with mount type '%s'", mount.Type)
184180
}

opts/mount_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,6 @@ func TestMountOptErrors(t *testing.T) {
113113
doc: "empty value",
114114
expErr: "value is empty",
115115
},
116-
{
117-
doc: "missing tmpfs target",
118-
value: "type=tmpfs",
119-
expErr: "target is required",
120-
},
121-
{
122-
doc: "missing bind target",
123-
value: "type=bind",
124-
expErr: "target is required",
125-
},
126-
{
127-
doc: "missing volume target",
128-
value: "type=volume,source=/foo",
129-
expErr: "target is required",
130-
},
131116
{
132117
doc: "invalid key=value",
133118
value: "type=volume,target=/foo,bogus=foo",

0 commit comments

Comments
 (0)