mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix(region): rds skip notImplementedErr (#18704)
* fix(region): rds skip notImplementedErr * fix(region): aws redis set metadata status --------- Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
This commit is contained in:
@@ -34,6 +34,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/compute/models"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/util/logclient"
|
||||
"yunion.io/x/onecloud/pkg/util/seclib2"
|
||||
)
|
||||
|
||||
@@ -427,3 +428,47 @@ func (self *SAwsRegionDriver) ValidateUpdateSecurityGroupRuleInput(ctx context.C
|
||||
|
||||
return self.SManagedVirtualizationRegionDriver.ValidateUpdateSecurityGroupRuleInput(ctx, userCred, input)
|
||||
}
|
||||
|
||||
func (self *SAwsRegionDriver) RequestRemoteUpdateElasticcache(ctx context.Context, userCred mcclient.TokenCredential, elasticcache *models.SElasticcache, replaceTags bool, task taskman.ITask) error {
|
||||
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
|
||||
iRegion, err := elasticcache.GetIRegion(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "elasticcache.GetIRegion")
|
||||
}
|
||||
|
||||
iElasticcache, err := iRegion.GetIElasticcacheById(elasticcache.ExternalId)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "GetIElasticcacheById(%s)", elasticcache.ExternalId)
|
||||
}
|
||||
|
||||
oldTags, err := iElasticcache.GetTags()
|
||||
if err != nil {
|
||||
if errors.Cause(err) == cloudprovider.ErrNotSupported || errors.Cause(err) == cloudprovider.ErrNotImplemented {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.Wrap(err, "iElasticcache.GetTags()")
|
||||
}
|
||||
tags, err := elasticcache.GetAllUserMetadata()
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "GetAllUserMetadata")
|
||||
}
|
||||
tagsUpdateInfo := cloudprovider.TagsUpdateInfo{OldTags: oldTags, NewTags: tags}
|
||||
mangerId := ""
|
||||
if vpc, _ := elasticcache.GetVpc(); vpc != nil {
|
||||
mangerId = vpc.ManagerId
|
||||
}
|
||||
err = cloudprovider.SetTags(ctx, iElasticcache, mangerId, tags, replaceTags)
|
||||
if err != nil {
|
||||
if errors.Cause(err) == cloudprovider.ErrNotSupported || errors.Cause(err) == cloudprovider.ErrNotImplemented {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
logclient.AddActionLogWithStartable(task, elasticcache, logclient.ACT_UPDATE_TAGS, err, userCred, false)
|
||||
return nil, errors.Wrap(err, "iElasticcache.SetTags")
|
||||
}
|
||||
cloudprovider.WaitMultiStatus(iElasticcache, []string{api.ELASTIC_CACHE_STATUS_RUNNING}, 15*time.Second, 2*time.Minute)
|
||||
logclient.AddActionLogWithStartable(task, elasticcache, logclient.ACT_UPDATE_TAGS, tagsUpdateInfo, userCred, true)
|
||||
return nil, nil
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2411,9 +2411,10 @@ func (self *SManagedVirtualizationRegionDriver) RequestRemoteUpdateDBInstance(ct
|
||||
|
||||
err = iRds.Update(ctx, cloudprovider.SDBInstanceUpdateOptions{NAME: instance.Name, Description: instance.Description})
|
||||
if err != nil {
|
||||
if errors.Cause(err) != cloudprovider.ErrNotSupported {
|
||||
return nil, errors.Wrap(err, "iRds.Update")
|
||||
if errors.Cause(err) == cloudprovider.ErrNotSupported || errors.Cause(err) == cloudprovider.ErrNotImplemented {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.Wrap(err, "iRds.Update")
|
||||
}
|
||||
return nil, nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user