Skip to content

Commit db105e2

Browse files
authored
catch up the latest Envoy (#886)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
1 parent 43d5198 commit db105e2

13 files changed

Lines changed: 96 additions & 17 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ jobs:
5353
FULL_ENVOY_VERSION=${ENVOY_API_VERSION}.0
5454
if [[ $ENVOY_API_VERSION == dev ]]; then
5555
# update this once there are more breaking changes
56-
FULL_ENVOY_VERSION=1.32.1-0.20241112025658-4fd9bb670eeb
57-
# This is the envoy:contrib-dev image pull in 2024-11-12.
56+
FULL_ENVOY_VERSION=1.33.1-0.20250411033243-86ca8d764bbd
57+
# This is the envoy:contrib-dev image pull in 2025-04-11.
5858
# Use docker inspect --format='{{index .RepoDigests 0}}' envoyproxy/envoy:contrib-dev to get the sha256 ID.
5959
# We don't use the envoy:contrib-dev tag directly because it will be rewritten by the latest commit and
6060
# our test suite uses IfPresent policy to pull image.
6161
# We don't use the CI to catch the breaking change from the upstream so far.
62-
export PROXY_IMAGE=envoyproxy/envoy@sha256:0eec2cbd45c2055ea37c2321e8b83f6907a95e98c250492b48ad9dab6a20a8cb
62+
export PROXY_IMAGE=envoyproxy/envoy@sha256:2e1202c7b0bc3694a8d4a4b642888602deab77ec1bf54cb8569184112b5c0ab3
6363
echo PROXY_IMAGE=$PROXY_IMAGE >> $GITHUB_ENV
6464
fi
6565
pushd ..

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
go.uber.org/zap v1.27.0
3232
golang.org/x/net v0.33.0
3333
google.golang.org/grpc v1.63.2
34-
google.golang.org/protobuf v1.35.1
34+
google.golang.org/protobuf v1.36.6
3535
gopkg.in/yaml.v3 v3.0.1
3636
)
3737

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:
5959
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
6060
google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
6161
google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
62-
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
63-
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
62+
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
63+
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
6464
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6565
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
6666
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

api/pkg/filtermanager/api/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ type StreamFilterCallbacks interface {
210210
// * ErrSerializationFailure (Currently, fetching attributes in List/Map type are unsupported)
211211
// * ErrValueNotFound
212212
GetProperty(key string) (string, error)
213+
SecretManager() SecretManager
214+
213215
// ClearRouteCache clears the route cache for the current request, and filtermanager will re-fetch the route in the next filter.
214216
// Please be careful to invoke it, since filtermanager will raise an 404 route_not_found response when failed to re-fetch a route.
215217
ClearRouteCache()
@@ -254,6 +256,8 @@ type FilterProcessCallbacks interface {
254256
// For example, turn a headers only request into a request with a body, add more body when processing trailers, and so on.
255257
// The second argument isStreaming supplies if this caller streams data or buffers the full body.
256258
AddData(data []byte, isStreaming bool)
259+
// InjectData inject the content of slice data via Envoy StreamXXFilterCallbacks's injectXXDataToFilterChaininjectData.
260+
InjectData(data []byte)
257261

258262
// hide Continue() method from the user
259263
}

api/pkg/filtermanager/api/api_129.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,6 @@ func LogCriticalf(format string, v ...any) {
114114
}
115115
api.LogCriticalf(format, v...)
116116
}
117+
118+
type SecretManager interface {
119+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright The HTNN Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
//go:build !envoy1.29 && !envoydev
16+
17+
package api
18+
19+
import "github.com/envoyproxy/envoy/contrib/golang/common/go/api"
20+
21+
var (
22+
LogTrace = api.LogTrace
23+
LogDebug = api.LogDebug
24+
LogInfo = api.LogInfo
25+
LogWarn = api.LogWarn
26+
LogError = api.LogError
27+
LogCritical = api.LogCritical
28+
LogTracef = api.LogTracef
29+
LogDebugf = api.LogDebugf
30+
LogInfof = api.LogInfof
31+
LogWarnf = api.LogWarnf
32+
LogErrorf = api.LogErrorf
33+
LogCriticalf = api.LogCriticalf
34+
35+
GetLogLevel = api.GetLogLevel
36+
)
37+
38+
type SecretManager interface {
39+
}

api/pkg/filtermanager/api/api_latest.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build !envoy1.29
15+
//go:build envoydev
1616

1717
package api
1818

@@ -36,3 +36,6 @@ var (
3636

3737
GetLogLevel = api.GetLogLevel
3838
)
39+
40+
// SecretManager exports the managed secret
41+
type SecretManager = api.SecretManager

api/pkg/filtermanager/api_impl_129.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ func (s *filterManagerStreamInfo) WorkerID() uint32 {
2929
return 0
3030
}
3131

32+
func (cb *filterManagerCallbackHandler) SecretManager() api.SecretManager {
33+
api.LogErrorf("SecretManager is not implemented: %s", debug.Stack())
34+
return nil
35+
}
36+
3237
func (cb *filterManagerCallbackHandler) ClearRouteCache() {
3338
api.LogErrorf("ClearRouteCache is not implemented: %s", debug.Stack())
3439
}
@@ -41,6 +46,10 @@ func (cb *filterManagerCallbackHandler) AddData([]byte, bool) {
4146
api.LogErrorf("AddData is not implemented: %s", debug.Stack())
4247
}
4348

49+
func (cb *filterManagerCallbackHandler) InjectData([]byte) {
50+
api.LogErrorf("InjectData is not implemented: %s", debug.Stack())
51+
}
52+
4453
func (cb *filterManagerCallbackHandler) DecoderFilterCallbacks() api.DecoderFilterCallbacks {
4554
return cb
4655
}

api/pkg/filtermanager/api_impl_131_132.go

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,50 @@ import (
2424
"mosn.io/htnn/api/pkg/filtermanager/api"
2525
)
2626

27+
func (cb *filterManagerCallbackHandler) SecretManager() api.SecretManager {
28+
api.LogErrorf("SecretManager is not implemented: %s", debug.Stack())
29+
return nil
30+
}
31+
2732
func (cb *filterManagerCallbackHandler) RefreshRouteCache() {
2833
api.LogErrorf("RefreshRouteCache is not implemented: %s", debug.Stack())
2934
}
3035

36+
type commonFilterCallbackHandlerWrapper struct {
37+
}
38+
39+
func (w *commonFilterCallbackHandlerWrapper) AddData([]byte, bool) {
40+
api.LogErrorf("AddData is not implemented: %s", debug.Stack())
41+
}
42+
43+
func (w *commonFilterCallbackHandlerWrapper) InjectData([]byte) {
44+
api.LogErrorf("InjectData is not implemented: %s", debug.Stack())
45+
}
46+
3147
type decoderFilterCallbackHandlerWrapper struct {
48+
commonFilterCallbackHandlerWrapper
49+
3250
capi.DecoderFilterCallbacks
3351
}
3452

3553
func NewDecoderFilterCallbackHandlerWrapper(h capi.DecoderFilterCallbacks) api.DecoderFilterCallbacks {
3654
return &decoderFilterCallbackHandlerWrapper{DecoderFilterCallbacks: h}
3755
}
3856

39-
func (w *decoderFilterCallbackHandlerWrapper) AddData([]byte, bool) {
40-
api.LogErrorf("AddData is not implemented: %s", debug.Stack())
41-
}
42-
4357
func (cb *filterManagerCallbackHandler) DecoderFilterCallbacks() api.DecoderFilterCallbacks {
4458
return NewDecoderFilterCallbackHandlerWrapper(cb.FilterCallbackHandler.DecoderFilterCallbacks())
4559
}
4660

4761
type encoderFilterCallbackHandlerWrapper struct {
62+
commonFilterCallbackHandlerWrapper
63+
4864
capi.EncoderFilterCallbacks
4965
}
5066

5167
func NewEncoderFilterCallbackHandlerWrapper(h capi.EncoderFilterCallbacks) api.EncoderFilterCallbacks {
5268
return &encoderFilterCallbackHandlerWrapper{EncoderFilterCallbacks: h}
5369
}
5470

55-
func (w *encoderFilterCallbackHandlerWrapper) AddData([]byte, bool) {
56-
api.LogErrorf("AddData is not implemented: %s", debug.Stack())
57-
}
58-
5971
func (cb *filterManagerCallbackHandler) EncoderFilterCallbacks() api.EncoderFilterCallbacks {
6072
return NewEncoderFilterCallbackHandlerWrapper(cb.FilterCallbackHandler.EncoderFilterCallbacks())
6173
}

api/pkg/plugins/type.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ type GoPlugin interface {
177177
Plugin
178178

179179
Factory() api.FilterFactory
180+
// TODO: add Destroy() support
180181
}
181182

182183
type ConsumerPlugin interface {

0 commit comments

Comments
 (0)