Skip to content

Commit b40501f

Browse files
authored
deps: bumps EG (#1770)
**Description** EG got a CVE recently. It doesn't affect AIGW users but upgrading it to the latest patch version silences CVE scanners. --------- Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
1 parent 993e83f commit b40501f

File tree

9 files changed

+482
-188
lines changed

9 files changed

+482
-188
lines changed

.github/workflows/build_and_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ jobs:
212212
include:
213213
- name: latest
214214
envoy_gateway_version: v0.0.0-latest
215-
- name: v1.6.0
216-
envoy_gateway_version: v1.6.0
215+
- name: v1.6.2
216+
envoy_gateway_version: v1.6.2
217217
steps:
218218
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
219219
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v5

cmd/aigw/download_envoy.go

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,27 @@ package main
77

88
import (
99
"context"
10-
"fmt"
1110
"io"
1211
"os"
13-
"regexp"
14-
"strings"
1512

16-
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
1713
func_e "github.com/tetratelabs/func-e"
1814
func_e_api "github.com/tetratelabs/func-e/api"
1915
)
2016

21-
var envoyVersionRe = regexp.MustCompile(`\d+\.\d+\.\d+`)
17+
// This matches the version in the .envoy-version file at the repo root. That is ensured in tests.
18+
// The reason why we don't use the constant defined in the EG as a library is that when we depend
19+
// on the main branch, it will be a non-released development version that func-e may not have.
20+
const envoyVersion = "1.37.0"
2221

2322
// downloadEnvoy downloads the Envoy binary used by Envoy Gateway.
2423
func downloadEnvoy(ctx context.Context, funcERun func_e_api.RunFunc, tmpDir, dataHome string, stdout, stderr io.Writer) error {
25-
version, err := getEnvoyVersion(egv1a1.DefaultEnvoyProxyImage)
26-
if err != nil {
27-
return err
28-
}
29-
3024
return funcERun(ctx, []string{"--version"},
3125
func_e_api.ConfigHome(tmpDir),
3226
func_e_api.DataHome(dataHome),
3327
func_e_api.StateHome(tmpDir),
3428
func_e_api.RuntimeDir(tmpDir),
3529
func_e_api.RunID("0"),
36-
func_e_api.EnvoyVersion(version),
30+
func_e_api.EnvoyVersion(envoyVersion),
3731
func_e_api.Out(stdout),
3832
func_e_api.EnvoyOut(stdout),
3933
func_e_api.EnvoyErr(stderr),
@@ -43,18 +37,3 @@ func downloadEnvoy(ctx context.Context, funcERun func_e_api.RunFunc, tmpDir, dat
4337
func downloadEnvoyCmd(ctx context.Context, c *cmdDownloadEnvoy, stdout, stderr io.Writer) error {
4438
return downloadEnvoy(ctx, func_e.Run, os.TempDir(), c.dataHome, stdout, stderr)
4539
}
46-
47-
func getEnvoyVersion(image string) (string, error) {
48-
if version := os.Getenv("ENVOY_VERSION"); version != "" {
49-
return version, nil
50-
}
51-
parts := strings.Split(image, ":")
52-
if len(parts) < 2 {
53-
return "", fmt.Errorf("no tag in default Envoy image: %s", image)
54-
}
55-
semver := envoyVersionRe.FindString(parts[len(parts)-1])
56-
if semver == "" {
57-
return "", fmt.Errorf("no semver in tag: %s", parts[len(parts)-1])
58-
}
59-
return semver, nil
60-
}

cmd/aigw/download_envoy_test.go

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,28 @@ package main
88
import (
99
"context"
1010
"io"
11+
"os"
12+
"strings"
1113
"testing"
1214

1315
"github.com/stretchr/testify/require"
1416
func_e_api "github.com/tetratelabs/func-e/api"
17+
18+
internaltesting "github.com/envoyproxy/ai-gateway/internal/testing"
1519
)
1620

1721
func Test_downloadEnvoy(t *testing.T) {
22+
t.Run("ensure the version constant matches the .envoy-version file", func(t *testing.T) {
23+
root := internaltesting.FindProjectRoot()
24+
envoyVersionInRoot, err := os.ReadFile(root + "/.envoy-version")
25+
require.NoError(t, err)
26+
require.Equal(t, envoyVersion, strings.TrimSpace(string(envoyVersionInRoot)))
27+
})
28+
1829
err := downloadEnvoy(t.Context(), func(_ context.Context, args []string, opts ...func_e_api.RunOption) error {
1930
require.Equal(t, []string{"--version"}, args)
2031
require.Len(t, opts, 9) // opts are internal so we can just count them
2132
return nil
2233
}, t.TempDir(), t.TempDir(), io.Discard, io.Discard)
2334
require.NoError(t, err)
2435
}
25-
26-
func Test_getEnvoyVersion(t *testing.T) {
27-
tests := []struct {
28-
name string
29-
envVersion string
30-
egVersion string
31-
expectedVersion string
32-
}{
33-
{
34-
name: "env override wins",
35-
envVersion: "1.37.0",
36-
egVersion: "1.36.2",
37-
expectedVersion: "1.37.0",
38-
},
39-
{
40-
name: "fallback to default",
41-
envVersion: "",
42-
egVersion: "1.36.2",
43-
expectedVersion: "1.36.2",
44-
},
45-
}
46-
47-
for _, tt := range tests {
48-
t.Run(tt.name, func(t *testing.T) {
49-
t.Setenv("ENVOY_VERSION", tt.envVersion)
50-
version, err := getEnvoyVersion("docker.io/envoyproxy/envoy:distroless-v" + tt.egVersion)
51-
require.NoError(t, err)
52-
require.Equal(t, tt.expectedVersion, version)
53-
})
54-
}
55-
t.Run("invalid image tag", func(t *testing.T) {
56-
_, err := getEnvoyVersion("docker.io/envoyproxy/envoy")
57-
require.Error(t, err)
58-
})
59-
}

cmd/aigw/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func run(ctx context.Context, c *cmdRun, o *runOpts, stdout, stderr io.Writer) e
9393
// First, we need to create the self-signed certificates used for communication between the EG and Envoy.
9494
// Certificates will be placed at ~/.config/envoy-gateway/certs, which is the default location used by Envoy Gateway.
9595
certGenOut := &bytes.Buffer{}
96-
certGen := root.GetRootCommand()
96+
certGen := root.GetRootCommand(nil)
9797
certGen.SetOut(certGenOut)
9898
certGen.SetErr(certGenOut)
9999
certGen.SetArgs([]string{"certgen", "--local"})
@@ -211,7 +211,7 @@ func run(ctx context.Context, c *cmdRun, o *runOpts, stdout, stderr io.Writer) e
211211
// Now running the `envoy-gateway` CLI alternative below by passing `--config-path` to `egConfigPath`.
212212
// Then the agent will read the resources from the file pointed inside the config and start the Envoy process.
213213

214-
server := root.GetRootCommand()
214+
server := root.GetRootCommand(nil)
215215
// TODO: enable the log by default after the issue is resolved: https://github.com/envoyproxy/gateway/issues/6596
216216
if c.Debug {
217217
server.SetOut(stdout)

go.mod

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ require (
1919
github.com/cohere-ai/cohere-go/v2 v2.16.1
2020
github.com/coreos/go-oidc/v3 v3.17.0
2121
github.com/docker/docker v28.5.2+incompatible
22-
github.com/envoyproxy/gateway v1.6.0
22+
github.com/envoyproxy/gateway v1.7.0-rc.0
2323
github.com/envoyproxy/go-control-plane v0.14.0
24-
github.com/envoyproxy/go-control-plane/envoy v1.36.0
24+
github.com/envoyproxy/go-control-plane/envoy v1.36.1-0.20260115164926-066cbd5b3989
2525
github.com/go-logr/logr v1.4.3
2626
github.com/golang-jwt/jwt/v5 v5.3.0
2727
github.com/google/cel-go v0.26.1
@@ -69,7 +69,7 @@ require (
6969
k8s.io/client-go v0.35.0
7070
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
7171
sigs.k8s.io/controller-runtime v0.23.0
72-
sigs.k8s.io/gateway-api v1.4.0
72+
sigs.k8s.io/gateway-api v1.4.1
7373
sigs.k8s.io/gateway-api-inference-extension v1.0.2
7474
sigs.k8s.io/yaml v1.6.0
7575
)
@@ -87,8 +87,7 @@ require (
8787
github.com/Microsoft/go-winio v0.6.2 // indirect
8888
github.com/NYTimes/gziphandler v1.1.1 // indirect
8989
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
90-
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
91-
github.com/avast/retry-go v3.0.0+incompatible // indirect
90+
github.com/avast/retry-go/v5 v5.0.0 // indirect
9291
github.com/aws/aws-sdk-go-v2/credentials v1.19.7 // indirect
9392
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17 // indirect
9493
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17 // indirect
@@ -107,30 +106,30 @@ require (
107106
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
108107
github.com/cespare/xxhash/v2 v2.3.0 // indirect
109108
github.com/cloudwego/base64x v0.1.6 // indirect
110-
github.com/cncf/xds/go v0.0.0-20251022180443-0feb69152e9f // indirect
109+
github.com/cncf/xds/go v0.0.0-20251110193048-8bfbf64dc13e // indirect
111110
github.com/containerd/errdefs v1.0.0 // indirect
112111
github.com/containerd/errdefs/pkg v0.3.0 // indirect
113112
github.com/containerd/log v0.1.0 // indirect
114113
github.com/containerd/platforms v0.2.1 // indirect
115-
github.com/containerd/stargz-snapshotter/estargz v0.17.0 // indirect
114+
github.com/containerd/stargz-snapshotter/estargz v0.18.1 // indirect
116115
github.com/containers/image/v5 v5.36.2 // indirect
117116
github.com/containers/storage v1.59.1 // indirect
118117
github.com/coreos/go-semver v0.3.1 // indirect
119118
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
120119
github.com/cpuguy83/dockercfg v0.3.2 // indirect
121120
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
122121
github.com/distribution/reference v0.6.0 // indirect
123-
github.com/docker/cli v28.5.1+incompatible // indirect
122+
github.com/docker/cli v29.1.5+incompatible // indirect
124123
github.com/docker/distribution v2.8.3+incompatible // indirect
125-
github.com/docker/docker-credential-helpers v0.9.3 // indirect
124+
github.com/docker/docker-credential-helpers v0.9.4 // indirect
126125
github.com/docker/go-connections v0.6.0 // indirect
127126
github.com/docker/go-units v0.5.0 // indirect
128127
github.com/dominikbraun/graph v0.23.0 // indirect
129-
github.com/ebitengine/purego v0.9.0 // indirect
128+
github.com/ebitengine/purego v0.9.1 // indirect
130129
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
131-
github.com/envoyproxy/go-control-plane/contrib v1.32.5-0.20251029084203-42a4a9261f66 // indirect
132-
github.com/envoyproxy/go-control-plane/ratelimit v0.1.1-0.20251029084203-42a4a9261f66 // indirect
133-
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
130+
github.com/envoyproxy/go-control-plane/contrib v1.36.1-0.20260115164926-066cbd5b3989 // indirect
131+
github.com/envoyproxy/go-control-plane/ratelimit v0.1.1-0.20260115164926-066cbd5b3989 // indirect
132+
github.com/envoyproxy/protoc-gen-validate v1.3.0 // indirect
134133
github.com/envoyproxy/ratelimit v1.4.1-0.20230427142404-e2a87f41d3a7 // indirect
135134
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
136135
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
@@ -141,24 +140,24 @@ require (
141140
github.com/go-logr/stdr v1.2.2 // indirect
142141
github.com/go-logr/zapr v1.3.0 // indirect
143142
github.com/go-ole/go-ole v1.3.0 // indirect
144-
github.com/go-openapi/analysis v0.24.0 // indirect
145-
github.com/go-openapi/errors v0.22.3 // indirect
146-
github.com/go-openapi/jsonpointer v0.22.1 // indirect
147-
github.com/go-openapi/jsonreference v0.21.2 // indirect
148-
github.com/go-openapi/loads v0.23.1 // indirect
149-
github.com/go-openapi/spec v0.22.0 // indirect
150-
github.com/go-openapi/strfmt v0.24.0 // indirect
143+
github.com/go-openapi/analysis v0.24.1 // indirect
144+
github.com/go-openapi/errors v0.22.4 // indirect
145+
github.com/go-openapi/jsonpointer v0.22.4 // indirect
146+
github.com/go-openapi/jsonreference v0.21.4 // indirect
147+
github.com/go-openapi/loads v0.23.2 // indirect
148+
github.com/go-openapi/spec v0.22.3 // indirect
149+
github.com/go-openapi/strfmt v0.25.0 // indirect
151150
github.com/go-openapi/swag v0.23.1 // indirect
152-
github.com/go-openapi/swag/conv v0.25.1 // indirect
151+
github.com/go-openapi/swag/conv v0.25.4 // indirect
153152
github.com/go-openapi/swag/fileutils v0.25.1 // indirect
154-
github.com/go-openapi/swag/jsonname v0.25.1 // indirect
155-
github.com/go-openapi/swag/jsonutils v0.25.1 // indirect
156-
github.com/go-openapi/swag/loading v0.25.1 // indirect
153+
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
154+
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
155+
github.com/go-openapi/swag/loading v0.25.4 // indirect
157156
github.com/go-openapi/swag/mangling v0.25.1 // indirect
158-
github.com/go-openapi/swag/stringutils v0.25.1 // indirect
159-
github.com/go-openapi/swag/typeutils v0.25.1 // indirect
160-
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
161-
github.com/go-openapi/validate v0.25.0 // indirect
157+
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
158+
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
159+
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
160+
github.com/go-openapi/validate v0.25.1 // indirect
162161
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
163162
github.com/gogo/protobuf v1.3.2 // indirect
164163
github.com/golang/protobuf v1.5.4 // indirect
@@ -175,14 +174,14 @@ require (
175174
github.com/josharian/intern v1.0.0 // indirect
176175
github.com/json-iterator/go v1.1.12 // indirect
177176
github.com/kelseyhightower/envconfig v1.4.0 // indirect
178-
github.com/klauspost/compress v1.18.1 // indirect
177+
github.com/klauspost/compress v1.18.3 // indirect
179178
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
180179
github.com/kylelemons/godebug v1.1.0 // indirect
181180
github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 // indirect
182181
github.com/lyft/gostats v0.4.1 // indirect
183182
github.com/magiconair/properties v1.8.10 // indirect
184183
github.com/mailru/easyjson v0.9.0 // indirect
185-
github.com/miekg/dns v1.1.68 // indirect
184+
github.com/miekg/dns v1.1.70 // indirect
186185
github.com/mitchellh/go-homedir v1.1.0 // indirect
187186
github.com/moby/docker-image-spec v1.3.1 // indirect
188187
github.com/moby/go-archive v0.1.0 // indirect
@@ -197,7 +196,7 @@ require (
197196
github.com/morikuni/aec v1.0.0 // indirect
198197
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
199198
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
200-
github.com/ohler55/ojg v1.26.10 // indirect
199+
github.com/ohler55/ojg v1.28.0 // indirect
201200
github.com/oklog/ulid v1.3.1 // indirect
202201
github.com/opencontainers/go-digest v1.0.0 // indirect
203202
github.com/opencontainers/image-spec v1.1.1 // indirect
@@ -208,32 +207,32 @@ require (
208207
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
209208
github.com/prometheus/otlptranslator v1.0.0 // indirect
210209
github.com/prometheus/procfs v0.19.2 // indirect
211-
github.com/shirou/gopsutil/v4 v4.25.9 // indirect
210+
github.com/shirou/gopsutil/v4 v4.25.12 // indirect
212211
github.com/shopspring/decimal v1.4.0 // indirect
213-
github.com/sirupsen/logrus v1.9.3 // indirect
214-
github.com/spf13/cobra v1.10.1 // indirect
212+
github.com/sirupsen/logrus v1.9.4-0.20251023124752-b61f268f75b6 // indirect
213+
github.com/spf13/cobra v1.10.2 // indirect
215214
github.com/spf13/pflag v1.0.10 // indirect
216215
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
217216
github.com/stoewer/go-strcase v1.3.1 // indirect
218217
github.com/telepresenceio/watchable v0.0.0-20220726211108-9bb86f92afa7 // indirect
219218
github.com/tidwall/match v1.1.1 // indirect
220219
github.com/tidwall/pretty v1.2.1 // indirect
221-
github.com/tklauser/go-sysconf v0.3.15 // indirect
222-
github.com/tklauser/numcpus v0.10.0 // indirect
220+
github.com/tklauser/go-sysconf v0.3.16 // indirect
221+
github.com/tklauser/numcpus v0.11.0 // indirect
223222
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
224223
github.com/ulikunitz/xz v0.5.15 // indirect
225-
github.com/vbatts/tar-split v0.12.1 // indirect
224+
github.com/vbatts/tar-split v0.12.2 // indirect
226225
github.com/x448/float16 v0.8.4 // indirect
227226
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
228227
github.com/yuin/gopher-lua v1.1.1 // indirect
229228
github.com/yusufpapurcu/wmi v1.2.4 // indirect
230229
go.etcd.io/etcd/api/v3 v3.6.5 // indirect
231230
go.etcd.io/etcd/client/pkg/v3 v3.6.5 // indirect
232231
go.etcd.io/etcd/client/v3 v3.6.5 // indirect
233-
go.mongodb.org/mongo-driver v1.17.4 // indirect
232+
go.mongodb.org/mongo-driver v1.17.6 // indirect
234233
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
235234
go.opentelemetry.io/contrib/bridges/prometheus v0.64.0 // indirect
236-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
235+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect
237236
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
238237
go.opentelemetry.io/contrib/propagators/aws v1.39.0 // indirect
239238
go.opentelemetry.io/contrib/propagators/b3 v1.39.0 // indirect

0 commit comments

Comments
 (0)