mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-06 19:54:26 +08:00
Merge pull request #5181 from tb365/bugfix/tb-bugfix-0219
Bugfix/tb bugfix 0219
This commit is contained in:
@@ -960,12 +960,17 @@ func (self *SRegion) ReplaceSystemDisk(ctx context.Context, instanceId string, i
|
||||
}
|
||||
log.Debugf("ReplaceSystemDisk replace root disk %s", rootDisk.DiskId)
|
||||
|
||||
subnetId := ""
|
||||
if len(instance.VpcAttributes.NetworkId) > 0 {
|
||||
subnetId = instance.VpcAttributes.NetworkId
|
||||
}
|
||||
|
||||
// create tmp server
|
||||
tempName := fmt.Sprintf("__tmp_%s", instance.GetName())
|
||||
_id, err := self.CreateInstance(tempName,
|
||||
imageId,
|
||||
instance.InstanceType,
|
||||
"",
|
||||
subnetId,
|
||||
"",
|
||||
instance.ZoneId,
|
||||
instance.Description,
|
||||
|
||||
@@ -691,7 +691,16 @@ func (self *SRegion) SyncElbListener(listener *SElbListener, config *cloudprovid
|
||||
|
||||
_, err = client.ModifyListener(params)
|
||||
if err != nil {
|
||||
return err
|
||||
if strings.Contains(err.Error(), "CertificateNotFound") {
|
||||
// aws 比较诡异,证书能查询到,但是如果立即创建会报错,这里只能等待一会重试
|
||||
time.Sleep(10 * time.Second)
|
||||
_, err = client.ModifyListener(params)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "SRegion.SyncElbListener.ModifyListener.Retry")
|
||||
}
|
||||
}
|
||||
|
||||
return errors.Wrap(err, "SRegion.SyncElbListener.ModifyListener")
|
||||
}
|
||||
|
||||
hc := &cloudprovider.SLoadbalancerHealthCheck{
|
||||
|
||||
@@ -377,7 +377,9 @@ func (self *SRegion) UpdateLoadBalancerBackendGroup(backendGroupID string, group
|
||||
}
|
||||
poolObj.Set("lb_algorithm", jsonutils.NewString(scheduler))
|
||||
|
||||
if group.StickySession != nil {
|
||||
if group.StickySession == nil || group.StickySession.StickySession == api.LB_BOOL_OFF {
|
||||
poolObj.Set("session_persistence", jsonutils.JSONNull)
|
||||
} else {
|
||||
s := jsonutils.NewDict()
|
||||
timeout := int64(group.StickySession.StickySessionCookieTimeout / 60)
|
||||
if group.ListenType == api.LB_LISTENER_TYPE_UDP || group.ListenType == api.LB_LISTENER_TYPE_TCP {
|
||||
|
||||
Reference in New Issue
Block a user