mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #11441 from ioito/hotfix/qx-pm-disable
fix(region): skip disabled project mapping
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user