@@ -113,33 +113,36 @@ type lbConfigJSON struct {
113
113
// ParseConfig parses the JSON load balancer config provided into an
114
114
// internal form or returns an error if the config is invalid.
115
115
//
116
- // When parsing a config update, the following validations are performed:
117
- // - routeLookupConfig:
118
- // - grpc_keybuilders field:
119
- // - must have at least one entry
120
- // - must not have two entries with the same `Name`
121
- // - within each entry:
122
- // - must have at least one `Name`
123
- // - must not have a `Name` with the `service` field unset or empty
124
- // - within each `headers` entry:
125
- // - must not have `required_match` set
126
- // - must not have `key` unset or empty
127
- // - across all `headers`, `constant_keys` and `extra_keys` fields:
128
- // - must not have the same `key` specified twice
129
- // - no `key` must be the empty string
130
- // - `lookup_service` field must be set and must parse as a target URI
131
- // - if `max_age` > 5m, it should be set to 5 minutes
132
- // - if `stale_age` > `max_age`, ignore it
133
- // - if `stale_age` is set, then `max_age` must also be set
134
- // - ignore `valid_targets` field
135
- // - `cache_size_bytes` field must have a value greater than 0, and if its
136
- // value is greater than 5M, we cap it at 5M
137
- // - routeLookupChannelServiceConfig:
138
- // - if specified, must parse as valid service config
139
- // - childPolicy:
140
- // - must find a valid child policy with a valid config
141
- // - childPolicyConfigTargetFieldName:
142
- // - must be set and non-empty
116
+ // When parsing a config update, the following validations are performed:
117
+ // - routeLookupConfig:
118
+ // - grpc_keybuilders field:
119
+ // - must have at least one entry
120
+ // - must not have two entries with the same `Name`
121
+ // - within each entry:
122
+ // - must have at least one `Name`
123
+ // - must not have a `Name` with the `service` field unset or empty
124
+ // - within each `headers` entry:
125
+ // - must not have `required_match` set
126
+ // - must not have `key` unset or empty
127
+ // - across all `headers`, `constant_keys` and `extra_keys` fields:
128
+ // - must not have the same `key` specified twice
129
+ // - no `key` must be the empty string
130
+ // - `lookup_service` field must be set and must parse as a target URI
131
+ // - if `max_age` > 5m, it should be set to 5 minutes
132
+ // - if `stale_age` > `max_age`, ignore it
133
+ // - if `stale_age` is set, then `max_age` must also be set
134
+ // - ignore `valid_targets` field
135
+ // - `cache_size_bytes` field must have a value greater than 0, and if its
136
+ // value is greater than 5M, we cap it at 5M
137
+ //
138
+ // - routeLookupChannelServiceConfig:
139
+ // - if specified, must parse as valid service config
140
+ //
141
+ // - childPolicy:
142
+ // - must find a valid child policy with a valid config
143
+ //
144
+ // - childPolicyConfigTargetFieldName:
145
+ // - must be set and non-empty
143
146
func (rlsBB ) ParseConfig (c json.RawMessage ) (serviceconfig.LoadBalancingConfig , error ) {
144
147
logger .Infof ("Received JSON service config: %v" , pretty .ToJSON (c ))
145
148
cfgJSON := & lbConfigJSON {}
0 commit comments