Skip to content

Commit b63d5cb

Browse files
authored
pkg/settings/cresettings: HTTPAction reorder and adjust defaults (#1667) (#1670)
(cherry picked from commit ab1bb63)
1 parent 45658d2 commit b63d5cb

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

pkg/settings/cresettings/defaults.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
},
6666
"HTTPAction": {
6767
"CallLimit": "5",
68-
"ResponseSizeLimit": "10kb",
68+
"CacheAgeLimit": "10m0s",
6969
"ConnectionTimeout": "10s",
70-
"RequestSizeLimit": "100kb",
71-
"CacheAgeLimit": "10m0s"
70+
"RequestSizeLimit": "10kb",
71+
"ResponseSizeLimit": "100kb"
7272
}
7373
}
7474
}

pkg/settings/cresettings/defaults.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ CallLimit = '2000'
6666

6767
[PerWorkflow.HTTPAction]
6868
CallLimit = '5'
69-
ResponseSizeLimit = '10kb'
70-
ConnectionTimeout = '10s'
71-
RequestSizeLimit = '100kb'
7269
CacheAgeLimit = '10m0s'
70+
ConnectionTimeout = '10s'
71+
RequestSizeLimit = '10kb'
72+
ResponseSizeLimit = '100kb'

pkg/settings/cresettings/settings.go

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Package cresettings contains configurable settings definitions for nodes in the CRE.
22
// Environment Variables:
3-
// - CL_CRE_SETTINGS_DEFAULT: defaults like in ./defaults.json - initializes Default
4-
// - CL_CRE_SETTINGS: scoped settings like in ../settings/testdata/config.json - initializes DefaultGetter
3+
// - CL_CRE_SETTINGS_DEFAULT: defaults like in ./defaults.json - initializes Default
4+
// - CL_CRE_SETTINGS: scoped settings like in ../settings/testdata/config.json - initializes DefaultGetter
55
package cresettings
66

77
import (
@@ -113,35 +113,39 @@ var Default = Schema{
113113
},
114114
HTTPAction: httpAction{
115115
CallLimit: Int(5),
116-
ResponseSizeLimit: Size(10 * config.KByte),
117-
ConnectionTimeout: Duration(10 * time.Second),
118-
RequestSizeLimit: Size(100 * config.KByte),
119116
CacheAgeLimit: Duration(10 * time.Minute),
117+
ConnectionTimeout: Duration(10 * time.Second),
118+
RequestSizeLimit: Size(10 * config.KByte),
119+
ResponseSizeLimit: Size(100 * config.KByte),
120120
},
121121
},
122122
}
123123

124124
type Schema struct {
125125
WorkflowLimit Setting[int] `unit:"{workflow}"`
126126
WorkflowExecutionConcurrencyLimit Setting[int] `unit:"{workflow}"`
127-
WorkflowTriggerRateLimit Setting[config.Rate]
128-
GatewayIncomingPayloadSizeLimit Setting[config.Size]
127+
// Deprecated
128+
WorkflowTriggerRateLimit Setting[config.Rate]
129+
GatewayIncomingPayloadSizeLimit Setting[config.Size]
129130

130131
PerOrg Orgs `scope:"org"`
131132
PerOwner Owners `scope:"owner"`
132133
PerWorkflow Workflows `scope:"workflow"`
133134
}
134135
type Orgs struct {
136+
// Deprecated
135137
WorkflowDeploymentRateLimit Setting[config.Rate]
136138
ZeroBalancePruningTimeout Setting[time.Duration]
137139
}
138140

139141
type Owners struct {
140142
WorkflowExecutionConcurrencyLimit Setting[int] `unit:"{workflow}"`
141-
WorkflowTriggerRateLimit Setting[config.Rate]
143+
// Deprecated
144+
WorkflowTriggerRateLimit Setting[config.Rate]
142145
}
143146

144147
type Workflows struct {
148+
// Deprecated
145149
TriggerRateLimit Setting[config.Rate]
146150
TriggerRegistrationsTimeout Setting[time.Duration]
147151
TriggerSubscriptionTimeout Setting[time.Duration]
@@ -185,12 +189,14 @@ type Workflows struct {
185189
}
186190

187191
type cronTrigger struct {
192+
// Deprecated: to be removed
188193
RateLimit Setting[config.Rate]
189194
}
190195
type httpTrigger struct {
191196
RateLimit Setting[config.Rate]
192197
}
193198
type logTrigger struct {
199+
// Deprecated
194200
Limit Setting[int] `unit:"{trigger}"`
195201
EventRateLimit Setting[config.Rate]
196202
EventSizeLimit Setting[config.Size]
@@ -213,10 +219,10 @@ type chainRead struct {
213219
}
214220
type httpAction struct {
215221
CallLimit Setting[int] `unit:"{call}"`
216-
ResponseSizeLimit Setting[config.Size]
222+
CacheAgeLimit Setting[time.Duration]
217223
ConnectionTimeout Setting[time.Duration]
218224
RequestSizeLimit Setting[config.Size]
219-
CacheAgeLimit Setting[time.Duration]
225+
ResponseSizeLimit Setting[config.Size]
220226
}
221227
type consensus struct {
222228
ObservationSizeLimit Setting[config.Size]

0 commit comments

Comments
 (0)