Skip to content

Commit

Permalink
Merge pull request #288 from 3scale-ops/feat/envoy-1.22-compatibility
Browse files Browse the repository at this point in the history
Feat/Add compatibility with envoy 1.22
  • Loading branch information
3scale-robot authored Jan 10, 2024
2 parents 8c4dfe6 + c8c5b79 commit 4a83247
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.21.0-alpha.20
VERSION ?= 0.21.0-alpha.21

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
8 changes: 4 additions & 4 deletions bundle/manifests/saas-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -598,15 +598,15 @@ metadata:
capabilities: Basic Install
categories: Integration & Delivery
containerImage: quay.io/3scale/saas-operator
createdAt: "2024-01-09T13:50:20Z"
createdAt: "2024-01-09T16:27:16Z"
description: |-
The 3scale SaaS Operator creates and maintains a SaaS-ready deployment
of the Red Hat 3scale API Management on OpenShift.
operators.operatorframework.io/builder: operator-sdk-v1.27.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/3scale-ops/saas-operator
support: Red Hat
name: saas-operator.v0.21.0-alpha.20
name: saas-operator.v0.21.0-alpha.21
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -4484,7 +4484,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
image: quay.io/3scale/saas-operator:v0.21.0-alpha.20
image: quay.io/3scale/saas-operator:v0.21.0-alpha.21
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -5048,4 +5048,4 @@ spec:
provider:
name: Red Hat
url: https://www.3scale.net/
version: 0.21.0-alpha.20
version: 0.21.0-alpha.21
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/3scale/saas-operator
newTag: v0.21.0-alpha.20
newTag: v0.21.0-alpha.21
22 changes: 11 additions & 11 deletions pkg/assets/bindata.go

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions pkg/resource_builders/envoyconfig/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ func TestNew(t *testing.T) {
max_connection_duration: 900s
http_filters:
- name: envoy.filters.http.router
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
http_protocol_options: {}
http2_protocol_options:
initial_connection_window_size: 1048576
Expand Down Expand Up @@ -164,7 +166,11 @@ func TestNew(t *testing.T) {
tls_minimum_protocol_version: TLSv1_2
listener_filters:
- name: envoy.filters.listener.tls_inspector
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
- name: envoy.filters.listener.proxy_protocol
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
name: my_listener
per_connection_buffer_limit_bytes: 32768
`),
Expand Down
40 changes: 39 additions & 1 deletion pkg/resource_builders/envoyconfig/templates/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
envoy_config_ratelimit_v3 "github.com/envoyproxy/go-control-plane/envoy/config/ratelimit/v3"
envoy_extensions_access_loggers_file_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3"
envoy_extensions_filters_http_ratelimit_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ratelimit/v3"
envoy_extensions_filters_http_router_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3"
envoy_extensions_filters_listener_proxy_protocol_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/listener/proxy_protocol/v3"
envoy_extensions_filters_listener_tls_inspector_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/listener/tls_inspector/v3"
http_connection_manager_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
envoy_extensions_transport_sockets_tls_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3"
"google.golang.org/protobuf/types/known/anypb"
Expand Down Expand Up @@ -94,11 +97,33 @@ func ListenerFilters_v1(tls, proxyProtocol bool) []*envoy_config_listener_v3.Lis
if tls {
filters = append(filters, &envoy_config_listener_v3.ListenerFilter{
Name: "envoy.filters.listener.tls_inspector",
ConfigType: &envoy_config_listener_v3.ListenerFilter_TypedConfig{
TypedConfig: func() *anypb.Any {
any, err := anypb.New(
&envoy_extensions_filters_listener_tls_inspector_v3.TlsInspector{},
)
if err != nil {
panic(err)
}
return any
}(),
},
})
}
if proxyProtocol {
filters = append(filters, &envoy_config_listener_v3.ListenerFilter{
Name: "envoy.filters.listener.proxy_protocol",
ConfigType: &envoy_config_listener_v3.ListenerFilter_TypedConfig{
TypedConfig: func() *anypb.Any {
any, err := anypb.New(
&envoy_extensions_filters_listener_proxy_protocol_v3.ProxyProtocol{},
)
if err != nil {
panic(err)
}
return any
}(),
},
})
}
return filters
Expand All @@ -124,7 +149,20 @@ func HttpFilters_v1(rlOpts *saasv1alpha1.RateLimitOptions) []*http_connection_ma
if rlOpts != nil {
filters = append(filters, HttpFilterRateLimit_v1(rlOpts))
}
filters = append(filters, &http_connection_manager_v3.HttpFilter{Name: "envoy.filters.http.router"})
filters = append(filters, &http_connection_manager_v3.HttpFilter{
Name: "envoy.filters.http.router",
ConfigType: &http_connection_manager_v3.HttpFilter_TypedConfig{
TypedConfig: func() *anypb.Any {
any, err := anypb.New(
&envoy_extensions_filters_http_router_v3.Router{},
)
if err != nil {
panic(err)
}
return any
}(),
},
})
return filters
}

Expand Down
10 changes: 10 additions & 0 deletions pkg/resource_builders/envoyconfig/templates/listeners_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func TestListenerHTTP_v1(t *testing.T) {
transport_api_version: V3
timeout: 0.010s
- name: envoy.filters.http.router
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
http_protocol_options:
accept_http_10: true
default_host_for_http_10: example.com
Expand Down Expand Up @@ -125,7 +127,11 @@ func TestListenerHTTP_v1(t *testing.T) {
tls_minimum_protocol_version: TLSv1_2
listener_filters:
- name: envoy.filters.listener.tls_inspector
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
- name: envoy.filters.listener.proxy_protocol
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
name: test
per_connection_buffer_limit_bytes: 32768
`),
Expand Down Expand Up @@ -197,6 +203,8 @@ func TestListenerHTTP_v1(t *testing.T) {
transport_api_version: V3
timeout: 0.010s
- name: envoy.filters.http.router
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
http_protocol_options:
accept_http_10: true
default_host_for_http_10: example.com
Expand All @@ -215,6 +223,8 @@ func TestListenerHTTP_v1(t *testing.T) {
use_remote_address: true
listener_filters:
- name: envoy.filters.listener.proxy_protocol
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
name: test
per_connection_buffer_limit_bytes: 32768
`),
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package version

const (
version string = "v0.21.0-alpha.20"
version string = "v0.21.0-alpha.21"
)

// Current returns the current marin3r operator version
Expand Down

0 comments on commit 4a83247

Please sign in to comment.