quota buildin mode,just limit all service or instance count
@@ -28,9 +28,7 @@ import (
const (
SERVICE_NUM_MAX_LIMIT = 12000
- SERVICE_NUM_MAX_LIMIT_PER_TENANT = 100
INSTANCE_NUM_MAX_LIMIT = 150000
- INSTANCE_NUM_MAX_LIMIT_PER_TENANT = 100
RULE_NUM_MAX_LIMIT_PER_SERVICE = 100
SCHEMA_NUM_MAX_LIMIT_PER_SERVICE = 1000
TAG_NUM_MAX_LIMIT_PER_SERVICE = 100
@@ -141,16 +139,6 @@ func quotaCheck(ctx context.Context, data *QuotaApplyData, getLimitQuota GetLimi
}
func instanceQuotaCheck(ctx context.Context, data *QuotaApplyData) (isOk bool, err error) {
- isOk, err = quotaCheck(ctx, data, getInstanceMaxLimitUnderOneTenant, getAllInstancesNumUnderOneTenant)
- if err != nil {
- util.Logger().Errorf(err, "instance quota check failed under one tenant")
- return
- }
- if !isOk {
- util.Logger().Errorf(err, "no quota to create instance under one tenant")
- return
- }
-
isOk, err = quotaCheck(ctx, data, getInstanceMaxLimit, getAllInstancesNum)
if err != nil {
util.Logger().Errorf(err, "instance quota check failed")
@@ -163,10 +151,6 @@ func instanceQuotaCheck(ctx context.Context, data *QuotaApplyData) (isOk bool, e
return
}
-func getInstanceMaxLimitUnderOneTenant() int64 {
- return INSTANCE_NUM_MAX_LIMIT_PER_TENANT
-}
-
func getInstanceMaxLimit() int64 {
return INSTANCE_NUM_MAX_LIMIT
}
@@ -187,22 +171,7 @@ func getAllInstancesNum(ctx context.Context, data *QuotaApplyData) (int64, error
return getInstancesNum(ctx, key)
}
-func getAllInstancesNumUnderOneTenant(ctx context.Context, data *QuotaApplyData) (int64, error) {
- key := core.GetInstanceRootKey(data.domain)
- return getInstancesNum(ctx, key)
-}
-
func serviceQuotaCheck(ctx context.Context, data *QuotaApplyData) (isOk bool, err error) {
- isOk, err = quotaCheck(ctx, data, getServiceMaxLimitUnderOneTenant, getAllServicesNumUnderOneTenant)
- if err != nil {
- util.Logger().Errorf(err, "service quota check failed under one tenant ")
- return
- }
- if !isOk {
- util.Logger().Errorf(err, "no quota to create service under one tenant")
- return
- }
-
isOk, err = quotaCheck(ctx, data, getServiceMaxLimit, getAllServicesNum)
if err != nil {
util.Logger().Errorf(err, "service quota check failed")
@@ -215,10 +184,6 @@ func serviceQuotaCheck(ctx context.Context, data *QuotaApplyData) (isOk bool, er
return
}
-func getServiceMaxLimitUnderOneTenant() int64 {
- return SERVICE_NUM_MAX_LIMIT_PER_TENANT
-}
-
func getServiceMaxLimit() int64 {
return SERVICE_NUM_MAX_LIMIT
}
@@ -238,8 +203,3 @@ func getAllServicesNum(ctx context.Context, data *QuotaApplyData) (int64, error)
key := core.GetServiceRootKey("")
return getServicesNum(ctx, key)
}
-
-func getAllServicesNumUnderOneTenant(ctx context.Context, data *QuotaApplyData) (int64, error) {
- key := core.GetServiceRootKey(data.domain)
- return getServicesNum(ctx, key)
-}
\ No newline at end of file
