Merge pull request #11442 from ioito/automated-cherry-pick-of-#11441-upstream-release-3.7

Automated cherry pick of #11441: fix(region): skip disabled project mapping
This commit is contained in:
Zexi Li
2021-06-18 18:32:29 +08:00
committed by GitHub
+7 -1
View File
@@ -123,7 +123,13 @@ type pmCache struct {
func (self *pmCache) GetProjectMapping() (*SProjectMapping, error) {
if len(self.ManagerProjectMappingId) > 0 {
return GetRuleMapping(self.ManagerProjectMappingId)
pm, err := GetRuleMapping(self.ManagerProjectMappingId)
if err != nil {
return nil, errors.Wrapf(err, "GetRuleMapping(%s)", self.ManagerProjectMappingId)
}
if pm.Enabled.IsTrue() {
return pm, nil
}
}
if len(self.AccountProjectMappingId) > 0 {
return GetRuleMapping(self.AccountProjectMappingId)