Skip to content

Commit

Permalink
Merge pull request #29 from softonic/fix_wrong_parameters_and_improve…
Browse files Browse the repository at this point in the history
…_cluster_envoyfilter

fields are not right
  • Loading branch information
santinoncs authored Oct 21, 2021
2 parents 2f6dc28 + 63b7753 commit 043eff1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions api/istio_v1alpha3/envoyfilter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type ListenerMatch_FilterMatch struct {
// The next level filter within this filter to match
// upon. Typically used for HTTP Connection Manager filters and
// Thrift filters.
SubFilter ListenerMatch_SubFilterMatch `json:"sub_filter,omitempty"`
SubFilter ListenerMatch_SubFilterMatch `json:"subFilter,omitempty"`
}

type ListenerMatch_FilterChainMatch struct {
Expand Down Expand Up @@ -110,7 +110,7 @@ type ListenerMatch struct {
// patch will be applied to the filter chain (and a specific
// filter if specified) and not to other filter chains in the
// listener.
FilterChain ListenerMatch_FilterChainMatch `json:"filter_chain,omitempty"`
FilterChain ListenerMatch_FilterChainMatch `json:"filterChain,omitempty"`
// Match a specific listener by its name. The listeners generated
// by Pilot are typically named as IP:Port.
Name string `json:"name,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions api/istio_v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/istio_v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions chart/rate-limit-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: rate-limit-operator
description:
type: application
version: 1.0.9
appVersion: 1.0.20
version: 1.0.10
appVersion: 1.0.21
4 changes: 2 additions & 2 deletions config/crd/bases/networking.istio.io_envoyfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ spec:
`protobuf_oneof:\"object_types\"` ObjectTypes isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes
`protobuf_oneof:\"object_types\"`"
properties:
filter_chain:
filterChain:
description: Match a specific filter chain in a listener.
If specified, the patch will be applied to the filter
chain (and a specific filter if specified) and not
Expand All @@ -106,7 +106,7 @@ spec:
should be used. Refer to https://www.envoyproxy.io/docs/envoy/latest/version_history/v1.14.0#deprecated
for canonical names.
type: string
sub_filter:
subFilter:
description: The next level filter within this
filter to match upon. Typically used for HTTP
Connection Manager filters and Thrift filters.
Expand Down
4 changes: 2 additions & 2 deletions controllers/envoyfilterobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func (r *RateLimitReconciler) prepareUpdateEnvoyFilterObjects(rateLimitInstance
fqdn := address + "." + controllerNamespace + ".svc.cluster.local"

nameCluster := "rate_limit_service_" + baseName

payload := []byte(fmt.Sprintf(`{"connect_timeout": "1.25s", "hosts": [ { "socket_address": { "address": "%s", "port_value": 8081 } } ], "http2_protocol_options": {}, "lb_policy": "ROUND_ROBIN", "name": "%s", "type": "STRICT_DNS" }`, fqdn, nameCluster))
payload := []byte(fmt.Sprintf(`{"connect_timeout":"1.25s","load_assignment":{"cluster_name":"%s","endpoints":[{"lb_endpoints":[{"endpoint":{"address":{"socket_address":{"address":"%s","port_value":8081}}}}]}]},"http2_protocol_options":{},"lb_policy":"ROUND_ROBIN","name":"%s","type":"STRICT_DNS"}`,fqdn, fqdn, nameCluster))

rawConfigCluster := json.RawMessage(payload)

Expand Down

0 comments on commit 043eff1

Please sign in to comment.