mirror of
https://github.com/docker/compose.git
synced 2026-05-13 13:58:02 +00:00
pkg/compose: defaultNetworkSettings: return early for unsupported feature
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
bdb630fb89
commit
08c32e9033
1 changed files with 8 additions and 8 deletions
|
|
@ -528,6 +528,14 @@ func defaultNetworkSettings(project *types.Project,
|
|||
return "none", nil, nil
|
||||
}
|
||||
|
||||
if versions.LessThan(version, APIVersion149) {
|
||||
for _, config := range service.Networks {
|
||||
if config != nil && config.InterfaceName != "" {
|
||||
return "", nil, fmt.Errorf("interface_name requires Docker Engine %s or later", DockerEngineV28_1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var primaryNetworkKey string
|
||||
if len(service.Networks) > 0 {
|
||||
primaryNetworkKey = service.NetworksByPriority()[0]
|
||||
|
|
@ -564,14 +572,6 @@ func defaultNetworkSettings(project *types.Project,
|
|||
}
|
||||
}
|
||||
|
||||
if versions.LessThan(version, APIVersion149) {
|
||||
for _, config := range service.Networks {
|
||||
if config != nil && config.InterfaceName != "" {
|
||||
return "", nil, fmt.Errorf("interface_name requires Docker Engine %s or later", DockerEngineV28_1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endpointsConfig[primaryNetworkMobyNetworkName] = primaryNetworkEndpoint
|
||||
networkConfig := &network.NetworkingConfig{
|
||||
EndpointsConfig: endpointsConfig,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue