(volume composetypes.ServiceVolumeConfig)
| 118 | } |
| 119 | |
| 120 | func handleBindToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) { |
| 121 | result := createMountFromVolume(volume) |
| 122 | |
| 123 | if volume.Source == "" { |
| 124 | return mount.Mount{}, errors.New("invalid bind source, source cannot be empty") |
| 125 | } |
| 126 | if volume.Volume != nil { |
| 127 | return mount.Mount{}, errors.New("volume options are incompatible with type bind") |
| 128 | } |
| 129 | if volume.Image != nil { |
| 130 | return mount.Mount{}, errors.New("image options are incompatible with type bind") |
| 131 | } |
| 132 | if volume.Tmpfs != nil { |
| 133 | return mount.Mount{}, errors.New("tmpfs options are incompatible with type bind") |
| 134 | } |
| 135 | if volume.Cluster != nil { |
| 136 | return mount.Mount{}, errors.New("cluster options are incompatible with type bind") |
| 137 | } |
| 138 | if volume.Bind != nil { |
| 139 | result.BindOptions = &mount.BindOptions{ |
| 140 | Propagation: mount.Propagation(volume.Bind.Propagation), |
| 141 | } |
| 142 | } |
| 143 | return result, nil |
| 144 | } |
| 145 | |
| 146 | func handleTmpfsToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) { |
| 147 | result := createMountFromVolume(volume) |
no test coverage detected
searching dependent graphs…