mirror of
https://github.com/docker/compose.git
synced 2025-07-23 13:45:00 +02:00
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
|
// TODO could identify volume by label vs name
|
||||||
_, err := s.apiClient.VolumeInspect(ctx, volume.Name)
|
_, err := s.apiClient.VolumeInspect(ctx, volume.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errdefs.IsNotFound(err) {
|
if !errdefs.IsNotFound(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
eventName := fmt.Sprintf("Volume %q", volume.Name)
|
eventName := fmt.Sprintf("Volume %q", volume.Name)
|
||||||
w := progress.ContextWriter(ctx)
|
w := progress.ContextWriter(ctx)
|
||||||
w.Event(progress.CreatingEvent(eventName))
|
w.Event(progress.CreatingEvent(eventName))
|
||||||
@ -1103,7 +1105,5 @@ func (s *composeService) ensureVolume(ctx context.Context, volume types.VolumeCo
|
|||||||
}
|
}
|
||||||
w.Event(progress.CreatedEvent(eventName))
|
w.Event(progress.CreatedEvent(eventName))
|
||||||
}
|
}
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -5,3 +5,13 @@ services:
|
|||||||
- ./static:/usr/share/nginx/html
|
- ./static:/usr/share/nginx/html
|
||||||
ports:
|
ports:
|
||||||
- 8090:80
|
- 8090:80
|
||||||
|
|
||||||
|
nginx2:
|
||||||
|
build: nginx-build
|
||||||
|
volumes:
|
||||||
|
- staticVol:/usr/share/nginx/html
|
||||||
|
ports:
|
||||||
|
- 9090:80
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
staticVol:
|
Loading…
x
Reference in New Issue
Block a user