mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
fix(region): return sql error
This commit is contained in:
@@ -83,7 +83,7 @@ func (p *CloudregionSchedtagPredicate) GetCandidateResource(c core.Candidater) I
|
||||
if zone == nil {
|
||||
return nil
|
||||
}
|
||||
region := zone.GetRegion()
|
||||
region, _ := zone.GetRegion()
|
||||
if region == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -185,10 +185,13 @@ func IsNetworkAvailable(
|
||||
}
|
||||
}
|
||||
|
||||
if wire != "" && !utils.HasPrefix(wire, n.WireId) && !utils.HasPrefix(wire, n.GetWire().GetName()) {
|
||||
return FailReason{
|
||||
Reason: fmt.Sprintf("Wire %s != %s", wire, n.WireId),
|
||||
Type: NetworkWire,
|
||||
if wire != "" && !utils.HasPrefix(wire, n.WireId) {
|
||||
_wire, _ := n.GetWire()
|
||||
if !utils.HasPrefix(wire, _wire.GetName()) {
|
||||
return FailReason{
|
||||
Reason: fmt.Sprintf("Wire %s != %s", wire, n.WireId),
|
||||
Type: NetworkWire,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -476,12 +476,12 @@ func (b *BaseHostDesc) fillCloudProvider(host *computemodels.SHost) error {
|
||||
}
|
||||
|
||||
func (b *BaseHostDesc) fillRegion(host *computemodels.SHost) error {
|
||||
b.Region = host.GetRegion()
|
||||
b.Region, _ = host.GetRegion()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *BaseHostDesc) fillZone(host *computemodels.SHost) error {
|
||||
zone := host.GetZone()
|
||||
zone, _ := host.GetZone()
|
||||
b.Zone = zone
|
||||
b.ZoneId = host.ZoneId
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user