Skip to content

Commit dac3178

Browse files
author
github-actions
committed
Merge tag '1.28.5' into tetrate-release-1.28
Istio release 1.28.5
2 parents 14d482e + 7da6662 commit dac3178

37 files changed

Lines changed: 984 additions & 93 deletions

Makefile.core.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ endif
4949
export VERSION
5050

5151
# Base version of Istio image to use
52-
BASE_VERSION ?= 1.28-2026-02-05T19-01-07
52+
BASE_VERSION ?= 1.28-2026-02-26T19-03-31
5353
ISTIO_BASE_REGISTRY ?= gcr.io/istio-release
5454

5555
export GO111MODULE ?= on

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ require (
8080
go.opentelemetry.io/proto/otlp v1.7.1
8181
go.uber.org/atomic v1.11.0
8282
go.uber.org/zap v1.27.0
83-
golang.org/x/net v0.44.0
83+
golang.org/x/net v0.47.0
8484
golang.org/x/oauth2 v0.30.0
85-
golang.org/x/sync v0.17.0
86-
golang.org/x/sys v0.36.0
85+
golang.org/x/sync v0.18.0
86+
golang.org/x/sys v0.38.0
8787
golang.org/x/time v0.12.0
8888
gomodules.xyz/jsonpatch/v2 v2.5.0
8989
google.golang.org/genproto/googleapis/api v0.0.0-20250811230008-5f3141c8851a
@@ -211,12 +211,12 @@ require (
211211
go.uber.org/multierr v1.11.0 // indirect
212212
go.yaml.in/yaml/v2 v2.4.2 // indirect
213213
go.yaml.in/yaml/v3 v3.0.4 // indirect
214-
golang.org/x/crypto v0.42.0 // indirect
214+
golang.org/x/crypto v0.45.0 // indirect
215215
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
216-
golang.org/x/mod v0.28.0 // indirect
217-
golang.org/x/term v0.35.0 // indirect
218-
golang.org/x/text v0.29.0 // indirect
219-
golang.org/x/tools v0.37.0 // indirect
216+
golang.org/x/mod v0.29.0 // indirect
217+
golang.org/x/term v0.37.0 // indirect
218+
golang.org/x/text v0.31.0 // indirect
219+
golang.org/x/tools v0.38.0 // indirect
220220
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
221221
gopkg.in/inf.v0 v0.9.1 // indirect
222222
k8s.io/component-base v0.34.1 // indirect

go.sum

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
527527
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
528528
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
529529
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
530-
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
531-
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
530+
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
531+
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
532532
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
533533
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
534534
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
@@ -538,8 +538,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
538538
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
539539
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
540540
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
541-
golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
542-
golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
541+
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
542+
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
543543
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
544544
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
545545
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -548,8 +548,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
548548
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
549549
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
550550
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
551-
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
552-
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
551+
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
552+
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
553553
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
554554
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
555555
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
@@ -558,8 +558,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
558558
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
559559
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
560560
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
561-
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
562-
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
561+
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
562+
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
563563
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
564564
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
565565
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -572,14 +572,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
572572
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
573573
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
574574
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
575-
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
576-
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
577-
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
578-
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
575+
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
576+
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
577+
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
578+
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
579579
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
580580
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
581-
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
582-
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
581+
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
582+
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
583583
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
584584
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
585585
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -591,8 +591,8 @@ golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtn
591591
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
592592
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
593593
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
594-
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
595-
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
594+
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
595+
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
596596
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
597597
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
598598
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

istio.deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "PROXY_REPO_SHA",
55
"repoName": "proxy",
66
"file": "",
7-
"lastStableSHA": "cc703bb68e23c81898b82a0205549300295851e8"
7+
"lastStableSHA": "21738f7c7009a5e8309bf002d546e118233f17b1"
88
},
99
{
1010
"_comment": "",

pilot/pkg/config/kube/gateway/backend_policies.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func DestinationRuleCollection(
237237
}
238238
}
239239
case kind.ServiceEntry:
240-
serviceEntryObj, err := references.LocalPolicyTargetRef(gw.LocalPolicyTargetReference{
240+
serviceEntryObj, err := references.LocalPolicyTargetRef(ctx, gw.LocalPolicyTargetReference{
241241
Group: "networking.istio.io",
242242
Kind: "ServiceEntry",
243243
Name: gw.ObjectName(target.Name),
@@ -317,7 +317,7 @@ func BackendTLSPolicyCollection(
317317
}
318318
return nil
319319
})
320-
tls.CredentialName = getBackendTLSCredentialName(s.Validation, i.Namespace, conds, references)
320+
tls.CredentialName = getBackendTLSCredentialName(ctx, s.Validation, i.Namespace, conds, references)
321321

322322
// In ancestor status, we need to report for Service (for mesh) and for each relevant Gateway.
323323
// However, there is a max of 16 items we can report.
@@ -329,7 +329,7 @@ func BackendTLSPolicyCollection(
329329
uniqueGateways := sets.New[types.NamespacedName]()
330330
for idx, t := range i.Spec.TargetRefs {
331331
conds = maps.Clone(conds)
332-
refo, err := references.LocalPolicyTargetRef(t.LocalPolicyTargetReference, i.Namespace)
332+
refo, err := references.LocalPolicyTargetRef(ctx, t.LocalPolicyTargetReference, i.Namespace)
333333
var sectionName *string
334334
if err == nil {
335335
switch refType := refo.(type) {
@@ -433,6 +433,7 @@ func BackendTLSPolicyCollection(
433433
}
434434

435435
func getBackendTLSCredentialName(
436+
ctx krt.HandlerContext,
436437
validation gw.BackendTLSPolicyValidation,
437438
policyNamespace string,
438439
conds map[string]*condition,
@@ -460,7 +461,7 @@ func getBackendTLSCredentialName(
460461
if len(validation.CACertificateRefs) > 1 {
461462
conds[string(gw.PolicyConditionAccepted)].message += "; warning: only the first caCertificateRefs will be used"
462463
}
463-
refo, err := references.LocalPolicyRef(ref, policyNamespace)
464+
refo, err := references.LocalPolicyRef(ctx, ref, policyNamespace)
464465
if err == nil {
465466
switch to := refo.(type) {
466467
case *v1.ConfigMap:
@@ -557,7 +558,7 @@ func BackendTrafficPolicyCollection(
557558

558559
for idx, t := range i.Spec.TargetRefs {
559560
conds = maps.Clone(conds)
560-
refo, err := references.XLocalPolicyTargetRef(t, i.Namespace)
561+
refo, err := references.XLocalPolicyTargetRef(ctx, t, i.Namespace)
561562
if err == nil {
562563
switch refo.(type) {
563564
case *v1.Service:

pilot/pkg/config/kube/gateway/conversion_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,30 @@ var services = []*model.Service{
158158
Ports: inferencePoolPorts,
159159
Hostname: host.Name(fmt.Sprintf("%s.default.svc.domain.suffix", firstValue(InferencePoolServiceName("infpool-gen2")))),
160160
},
161+
{
162+
Attributes: model.ServiceAttributes{
163+
Namespace: "default",
164+
Labels: map[string]string{
165+
InferencePoolExtensionRefSvc: "model1-epp",
166+
InferencePoolExtensionRefPort: "9002",
167+
InferencePoolExtensionRefFailureMode: "FailClose",
168+
},
169+
},
170+
Ports: ports,
171+
Hostname: host.Name(fmt.Sprintf("%s.default.svc.domain.suffix", firstValue(InferencePoolServiceName("infpool-model1")))),
172+
},
173+
{
174+
Attributes: model.ServiceAttributes{
175+
Namespace: "default",
176+
Labels: map[string]string{
177+
InferencePoolExtensionRefSvc: "model2-epp",
178+
InferencePoolExtensionRefPort: "9002",
179+
InferencePoolExtensionRefFailureMode: "FailClose",
180+
},
181+
},
182+
Ports: ports,
183+
Hostname: host.Name(fmt.Sprintf("%s.default.svc.domain.suffix", firstValue(InferencePoolServiceName("infpool-model2")))),
184+
},
161185

162186
{
163187
Attributes: model.ServiceAttributes{

pilot/pkg/config/kube/gateway/references.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,35 @@ import (
2929
// ReferenceSet stores a variety of different types of resource, and allows looking them up as Gateway API references.
3030
// This is merely a convenience to avoid needing to lookup up a bunch of types all over the place.
3131
type ReferenceSet struct {
32-
erasedCollections map[config.GroupVersionKind]func(name, namespace string) (any, bool)
32+
erasedCollections map[config.GroupVersionKind]func(ctx krt.HandlerContext, name, namespace string) (any, bool)
3333
}
3434

35-
func (s ReferenceSet) LocalPolicyTargetRef(ref gatewayv1.LocalPolicyTargetReference, localNamespace string) (any, error) {
36-
return s.internal(string(ref.Name), string(ref.Group), string(ref.Kind), localNamespace)
35+
func (s ReferenceSet) LocalPolicyTargetRef(ctx krt.HandlerContext, ref gatewayv1.LocalPolicyTargetReference, localNamespace string) (any, error) {
36+
return s.internal(ctx, string(ref.Name), string(ref.Group), string(ref.Kind), localNamespace)
3737
}
3838

39-
func (s ReferenceSet) XLocalPolicyTargetRef(ref gatewayx.LocalPolicyTargetReference, localNamespace string) (any, error) {
40-
return s.internal(string(ref.Name), string(ref.Group), string(ref.Kind), localNamespace)
39+
func (s ReferenceSet) XLocalPolicyTargetRef(ctx krt.HandlerContext, ref gatewayx.LocalPolicyTargetReference, localNamespace string) (any, error) {
40+
return s.internal(ctx, string(ref.Name), string(ref.Group), string(ref.Kind), localNamespace)
4141
}
4242

43-
func (s ReferenceSet) LocalPolicyRef(ref gatewayv1.LocalObjectReference, localNamespace string) (any, error) {
44-
return s.internal(string(ref.Name), string(ref.Group), string(ref.Kind), localNamespace)
43+
func (s ReferenceSet) LocalPolicyRef(ctx krt.HandlerContext, ref gatewayv1.LocalObjectReference, localNamespace string) (any, error) {
44+
return s.internal(ctx, string(ref.Name), string(ref.Group), string(ref.Kind), localNamespace)
4545
}
4646

47-
func (s ReferenceSet) internal(name, group, kind, localNamespace string) (any, error) {
47+
func (s ReferenceSet) internal(ctx krt.HandlerContext, name, group, kind, localNamespace string) (any, error) {
4848
t := normalizeReference(&group, &kind, config.GroupVersionKind{})
4949
lookup, f := s.erasedCollections[t]
5050
if !f {
5151
return nil, fmt.Errorf("unsupported kind %v", kind)
5252
}
53-
if v, ok := lookup(name, localNamespace); ok {
53+
if v, ok := lookup(ctx, name, localNamespace); ok {
5454
return v, nil
5555
}
5656
return nil, fmt.Errorf("reference %v/%v (of kind %v) not found", localNamespace, name, kind)
5757
}
5858

5959
func NewReferenceSet(opts ...func(r *ReferenceSet)) *ReferenceSet {
60-
r := &ReferenceSet{erasedCollections: make(map[config.GroupVersionKind]func(name, namespace string) (any, bool))}
60+
r := &ReferenceSet{erasedCollections: make(map[config.GroupVersionKind]func(ctx krt.HandlerContext, name, namespace string) (any, bool))}
6161
for _, opt := range opts {
6262
opt(r)
6363
}
@@ -67,8 +67,8 @@ func NewReferenceSet(opts ...func(r *ReferenceSet)) *ReferenceSet {
6767
func AddReference[T runtime.Object](c krt.Collection[T]) func(r *ReferenceSet) {
6868
return func(r *ReferenceSet) {
6969
g := schematypes.MustGVKFromType[T]()
70-
r.erasedCollections[g] = func(name, namespace string) (any, bool) {
71-
o := c.GetKey(namespace + "/" + name)
70+
r.erasedCollections[g] = func(ctx krt.HandlerContext, name, namespace string) (any, bool) {
71+
o := krt.FetchOne(ctx, c, krt.FilterKey(namespace+"/"+name))
7272
if o == nil {
7373
return nil, false
7474
}

pilot/pkg/config/kube/gateway/route_collections.go

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,63 @@ func mergeHTTPRoutes(baseVirtualServices krt.Collection[RouteWithKey], opts ...k
813813
sortRoutesByCreationTime(configs)
814814
base := configs[0].DeepCopy()
815815
baseVS := base.Spec.(*istio.VirtualService)
816-
for _, config := range configs[1:] {
816+
// Deep copy the InferencePool configs map to avoid race conditions
817+
// The default DeepCopy() only does shallow copy of Extra field
818+
if base.Extra != nil {
819+
if ipConfigs, ok := base.Extra[constants.ConfigExtraPerRouteRuleInferencePoolConfigs].(map[string]kube.InferencePoolRouteRuleConfig); ok {
820+
// Create a new map to avoid modifying the shared underlying map
821+
newIPConfigs := make(map[string]kube.InferencePoolRouteRuleConfig, len(ipConfigs))
822+
for k, v := range ipConfigs {
823+
newIPConfigs[k] = v
824+
}
825+
base.Extra[constants.ConfigExtraPerRouteRuleInferencePoolConfigs] = newIPConfigs
826+
}
827+
}
828+
for i, config := range configs[1:] {
817829
thisVS := config.Spec.(*istio.VirtualService)
818830
baseVS.Http = append(baseVS.Http, thisVS.Http...)
819831
// append parents
820832
base.Annotations[constants.InternalParentNames] = fmt.Sprintf("%s,%s",
821833
base.Annotations[constants.InternalParentNames], config.Annotations[constants.InternalParentNames])
834+
// Merge Extra field (especially for InferencePool configs)
835+
if base.Extra == nil && config.Extra != nil {
836+
base.Extra = make(map[string]any)
837+
}
838+
if config.Extra != nil {
839+
for k, v := range config.Extra {
840+
// For non-InferencePool configs, keep the first value for stability
841+
if k != constants.ConfigExtraPerRouteRuleInferencePoolConfigs {
842+
if _, exists := base.Extra[k]; !exists {
843+
base.Extra[k] = v
844+
}
845+
continue
846+
}
847+
// For InferencePool configs, merge the maps
848+
baseMap, baseOk := base.Extra[k].(map[string]kube.InferencePoolRouteRuleConfig)
849+
configMap, configOk := v.(map[string]kube.InferencePoolRouteRuleConfig)
850+
if baseOk && configOk {
851+
log.Debugf("Merging InferencePool configs: adding %d route configs from VirtualService %d to base (namespace=%s)",
852+
len(configMap), i+1, config.Namespace)
853+
// Route names are composed of the HTTPRoute/VirtualService namespaced name so they can't possibly conflict
854+
for routeName, routeConfig := range configMap {
855+
baseMap[routeName] = routeConfig
856+
}
857+
} else if configOk {
858+
if _, exists := base.Extra[k]; !exists {
859+
log.Debugf("Creating new InferencePool config map from VirtualService %d (namespace=%s)", i+1, config.Namespace)
860+
base.Extra[k] = v
861+
}
862+
} else if !configOk {
863+
log.Debugf("Skipping InferencePool config from VirtualService %d due to unexpected type (namespace=%s)", i+1, config.Namespace)
864+
}
865+
}
866+
}
867+
}
868+
// Log final merged InferencePool configs
869+
if base.Extra != nil {
870+
if ipConfigs, ok := base.Extra[constants.ConfigExtraPerRouteRuleInferencePoolConfigs].(map[string]kube.InferencePoolRouteRuleConfig); ok {
871+
log.Debugf("Final merged VirtualService for key %s has %d InferencePool route configs", object.Key, len(ipConfigs))
872+
}
822873
}
823874
sortHTTPRoutes(baseVS.Http)
824875
base.Name = strings.ReplaceAll(object.Key, "/", "~")

pilot/pkg/config/kube/gateway/testdata/http.status.yaml.golden

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ metadata:
1414
spec: null
1515
status: {}
1616
---
17+
apiVersion: inference.networking.k8s.io/v1
18+
kind: InferencePool
19+
metadata:
20+
name: infpool-model1
21+
namespace: default
22+
spec: null
23+
status: {}
24+
---
25+
apiVersion: inference.networking.k8s.io/v1
26+
kind: InferencePool
27+
metadata:
28+
name: infpool-model2
29+
namespace: default
30+
spec: null
31+
status: {}
32+
---
1733
apiVersion: gateway.networking.k8s.io/v1beta1
1834
kind: GatewayClass
1935
metadata:

0 commit comments

Comments
 (0)