Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
  • Loading branch information
zhaohuabing committed Apr 7, 2024
1 parent 40e996e commit a033009
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/xds/translator/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,16 @@ func GetRateLimitServiceConfigStr(pbCfg *rlsconfv3.RateLimitConfig) (string, err
enc.SetIndent(2)
// Translate pb config to yaml
yamlRoot := config.ConfigXdsProtoToYaml(pbCfg)
err := enc.Encode(*yamlRoot)
rateLimitConfig := &struct {
Name string
Domain string
Descriptors []config.YamlDescriptor
}{
Name: pbCfg.Name,
Domain: yamlRoot.Domain,
Descriptors: yamlRoot.Descriptors,
}
err := enc.Encode(rateLimitConfig)
return buf.String(), err
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: first-listener
domain: first-listener
descriptors:
- key: first-route
Expand Down

0 comments on commit a033009

Please sign in to comment.