mirror of https://github.com/docker/compose.git
Fix compose volume creation and check this in volume e2e test
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
6aec88e74c
commit
fe363fd146
|
@ -1086,7 +1086,9 @@ func (s *composeService) ensureVolume(ctx context.Context, volume types.VolumeCo
|
|||
// TODO could identify volume by label vs name
|
||||
_, err := s.apiClient.VolumeInspect(ctx, volume.Name)
|
||||
if err != nil {
|
||||
if errdefs.IsNotFound(err) {
|
||||
if !errdefs.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
eventName := fmt.Sprintf("Volume %q", volume.Name)
|
||||
w := progress.ContextWriter(ctx)
|
||||
w.Event(progress.CreatingEvent(eventName))
|
||||
|
@ -1103,7 +1105,5 @@ func (s *composeService) ensureVolume(ctx context.Context, volume types.VolumeCo
|
|||
}
|
||||
w.Event(progress.CreatedEvent(eventName))
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -5,3 +5,13 @@ services:
|
|||
- ./static:/usr/share/nginx/html
|
||||
ports:
|
||||
- 8090:80
|
||||
|
||||
nginx2:
|
||||
build: nginx-build
|
||||
volumes:
|
||||
- staticVol:/usr/share/nginx/html
|
||||
ports:
|
||||
- 9090:80
|
||||
|
||||
volumes:
|
||||
staticVol:
|
Loading…
Reference in New Issue