mirror of https://github.com/docker/compose.git
Local compose error when external network not available
Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
ab41285a07
commit
d24ffd97a0
|
@ -558,6 +558,10 @@ func (s *composeService) ensureNetwork(ctx context.Context, n types.NetworkConfi
|
||||||
_, err := s.apiClient.NetworkInspect(ctx, n.Name, moby.NetworkInspectOptions{})
|
_, err := s.apiClient.NetworkInspect(ctx, n.Name, moby.NetworkInspectOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errdefs.IsNotFound(err) {
|
if errdefs.IsNotFound(err) {
|
||||||
|
if n.External.External {
|
||||||
|
return fmt.Errorf("Network %s declared as external, but could not be found", n.Name)
|
||||||
|
}
|
||||||
|
|
||||||
createOpts := moby.NetworkCreate{
|
createOpts := moby.NetworkCreate{
|
||||||
// TODO NameSpace Labels
|
// TODO NameSpace Labels
|
||||||
Labels: n.Labels,
|
Labels: n.Labels,
|
||||||
|
|
Loading…
Reference in New Issue