redis update tags fix

This commit is contained in:
tangbin
2021-03-03 10:17:14 +08:00
committed by TangBin
parent f2645a2045
commit 6ae4883db2
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -3024,7 +3024,7 @@ func (self *SManagedVirtualizationRegionDriver) RequestRemoteUpdateElasticcache(
iElasticcache, err := iRegion.GetIElasticcacheById(elasticcache.ExternalId)
oldTags, err := iElasticcache.GetTags()
if err != nil {
if err != nil && errors.Cause(err) != cloudprovider.ErrNotFound {
return nil, errors.Wrap(err, "iElasticcache.GetTags()")
}
tags, err := elasticcache.GetAllUserMetadata()
@@ -945,6 +945,7 @@ func (instance *SElasticcache) GetTags() (map[string]string, error) {
return nil, errors.Wrap(err, "instance.region.ListResourceTags")
}
if _, ok := tags[instance.GetId()]; !ok {
log.Debugf("SElasticcache.GetTags %s, tags %#v", instance.GetId(), tags)
return nil, cloudprovider.ErrNotFound
}
return *tags[instance.GetId()], nil