@@ -13,10 +13,10 @@ import (
13
13
"google.golang.org/protobuf/types/known/wrapperspb"
14
14
15
15
ggv2utils "github.com/solo-io/gloo/projects/gateway2/utils"
16
- "github.com/solo-io/gloo/projects/gloo/constants"
17
16
v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
18
17
glookubev1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/kube/apis/gloo.solo.io/v1"
19
18
kubeplugin "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/kubernetes"
19
+ "github.com/solo-io/gloo/projects/gloo/pkg/plugins/istio_automtls"
20
20
"github.com/solo-io/gloo/projects/gloo/pkg/translator"
21
21
"github.com/solo-io/go-utils/contextutils"
22
22
"istio.io/istio/pkg/kube"
@@ -336,7 +336,7 @@ func CreateLBEndpoint(address string, port uint32, podLabels map[string]string,
336
336
metadata := & envoy_config_core_v3.Metadata {
337
337
FilterMetadata : map [string ]* structpb.Struct {},
338
338
}
339
- metadata = addIstioAutomtlsMetadata (metadata , podLabels , enableAutoMtls )
339
+ metadata = istio_automtls . AddIstioAutomtlsMetadata (metadata , podLabels , enableAutoMtls )
340
340
// Don't add the annotations to the metadata - it's not documented so it's not coming
341
341
// metadata = addAnnotations(metadata, addr.GetMetadata().GetAnnotations())
342
342
@@ -365,24 +365,6 @@ func CreateLBEndpoint(address string, port uint32, podLabels map[string]string,
365
365
}
366
366
}
367
367
368
- func addIstioAutomtlsMetadata (metadata * envoy_config_core_v3.Metadata , labels map [string ]string , enableAutoMtls bool ) * envoy_config_core_v3.Metadata {
369
- const EnvoyTransportSocketMatch = "envoy.transport_socket_match"
370
- if enableAutoMtls {
371
- if _ , ok := labels [constants .IstioTlsModeLabel ]; ok {
372
- metadata .GetFilterMetadata ()[EnvoyTransportSocketMatch ] = & structpb.Struct {
373
- Fields : map [string ]* structpb.Value {
374
- constants .TLSModeLabelShortname : {
375
- Kind : & structpb.Value_StringValue {
376
- StringValue : constants .IstioMutualTLSModeLabel ,
377
- },
378
- },
379
- },
380
- }
381
- }
382
- }
383
- return metadata
384
- }
385
-
386
368
func findPortForService (kctx krt.HandlerContext , services krt.Collection [* corev1.Service ], spec * kubeplugin.UpstreamSpec ) (* corev1.ServicePort , bool ) {
387
369
maybeSvc := krt .FetchOne (kctx , services , krt .FilterObjectName (types.NamespacedName {
388
370
Namespace : spec .GetServiceNamespace (),
0 commit comments