scheduler: ignore network type when specified

This commit is contained in:
Zexi Li
2020-09-12 15:56:40 +08:00
parent 33a5422aed
commit e129d580bd
@@ -118,13 +118,6 @@ func IsNetworkAvailable(
return len(data.HostId) > 0
}
if !isMatchServerType(n.SNetwork) {
return FailReason{
Reason: fmt.Sprintf("Network %s type %s match", n.Name, n.ServerType),
Type: NetworkTypeMatch,
}
}
if n.IsExitNetwork() != exit {
return FailReason{Reason: ErrExitIsNotMatch}
}
@@ -176,6 +169,14 @@ func IsNetworkAvailable(
Type: NetworkMatch,
}
}
} else {
if !isMatchServerType(n.SNetwork) {
return FailReason{
Reason: fmt.Sprintf("Network %s type %s match", n.Name, n.ServerType),
Type: NetworkTypeMatch,
}
}
}
if req.Network == "" && n.IsAutoAlloc.IsFalse() {