refact(ratelimit): Rename MaxEntries to MaxQuotas
This commit is contained in:
9 files changed
+54
-54
No files matched your search
@@ -215,9 +215,9 @@ type Controller struct {
|
||||
// TODO: This field is currently internal.
|
||||
SchedulerRunJobInterval time.Duration `hcl:"-"`
|
||||
|
||||
ApiRateLimits ratelimit.Configs `hcl:"-"`
|
||||
ApiRateLimiterMaxEntries int `hcl:"api_rate_limit_max_entries"`
|
||||
ApiRateLimitDisable bool `hcl:"api_rate_limit_disable"`
|
||||
ApiRateLimits ratelimit.Configs `hcl:"-"`
|
||||
ApiRateLimiterMaxQuotas int `hcl:"api_rate_limit_max_quotas"`
|
||||
ApiRateLimitDisable bool `hcl:"api_rate_limit_disable"`
|
||||
|
||||
// License is the license used by HCP builds
|
||||
License string `hcl:"license"`
|
||||
@@ -693,8 +693,8 @@ func Parse(d string) (*Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Controller.ApiRateLimiterMaxEntries <= 0 {
|
||||
result.Controller.ApiRateLimiterMaxEntries = ratelimit.DefaultLimiterMaxEntries()
|
||||
if result.Controller.ApiRateLimiterMaxQuotas <= 0 {
|
||||
result.Controller.ApiRateLimiterMaxQuotas = ratelimit.DefaultLimiterMaxQuotas()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -844,7 +844,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -1283,7 +1283,7 @@ func TestLoad(t *testing.T) {
|
||||
Unlimited: false,
|
||||
},
|
||||
},
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -1703,7 +1703,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -1794,7 +1794,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
|
||||
@@ -110,10 +110,10 @@ func TestDevController(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Controller: &Controller{
|
||||
Name: "dev-controller",
|
||||
Description: "A default controller created in dev mode",
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
Name: "dev-controller",
|
||||
Description: "A default controller created in dev mode",
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
DevController: true,
|
||||
}
|
||||
@@ -485,10 +485,10 @@ func TestDevCombined(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Controller: &Controller{
|
||||
Name: "dev-controller",
|
||||
Description: "A default controller created in dev mode",
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
Name: "dev-controller",
|
||||
Description: "A default controller created in dev mode",
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
DevController: true,
|
||||
Worker: &Worker{
|
||||
|
||||
Reference in new issue
Block a user