(volume composetypes.ServiceVolumeConfig)
| 144 | } |
| 145 | |
| 146 | func handleTmpfsToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) { |
| 147 | result := createMountFromVolume(volume) |
| 148 | |
| 149 | if volume.Source != "" { |
| 150 | return mount.Mount{}, errors.New("invalid tmpfs source, source must be empty") |
| 151 | } |
| 152 | if volume.Bind != nil { |
| 153 | return mount.Mount{}, errors.New("bind options are incompatible with type tmpfs") |
| 154 | } |
| 155 | if volume.Volume != nil { |
| 156 | return mount.Mount{}, errors.New("volume options are incompatible with type tmpfs") |
| 157 | } |
| 158 | if volume.Image != nil { |
| 159 | return mount.Mount{}, errors.New("image options are incompatible with type tmpfs") |
| 160 | } |
| 161 | if volume.Cluster != nil { |
| 162 | return mount.Mount{}, errors.New("cluster options are incompatible with type tmpfs") |
| 163 | } |
| 164 | if volume.Tmpfs != nil { |
| 165 | result.TmpfsOptions = &mount.TmpfsOptions{ |
| 166 | SizeBytes: volume.Tmpfs.Size, |
| 167 | } |
| 168 | } |
| 169 | return result, nil |
| 170 | } |
| 171 | |
| 172 | func handleNpipeToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) { |
| 173 | result := createMountFromVolume(volume) |
no test coverage detected
searching dependent graphs…